Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Uruchamianie Eksploratora windows

18 views
Skip to first unread message

Phantom

unread,
Feb 5, 2020, 4:24:20 AM2/5/20
to
Witam

Mam następującą deklarację do kodów uruchamiających eksplorator:
Private Declare Function GetOpenFileName Lib "comdlg32.dll" _
Alias "GetOpenFileNameA" _
(pOpenfilename As OPENFILENAME) As Long

Nie było z tym nigdy problemu do ostatniej aktualizacji windowsa 10.
Dostaję komunikat o braku zgodności z wersjami 32/64 bit.

Próbowałem rejestrować dll ale bez powodzenia.
Proszę o pomoc lub przykład jakiegoś innego kodu na wykorzystanie możliwości eksploratora windows.

Pozdrawiam
Tomek

BraZby

unread,
Feb 7, 2020, 4:32:20 AM2/7/20
to
W dniu 2020-02-05 o 10:24, Phantom pisze:
A czy przypadkiem MS Access jest w wersji 64-bitowej?

--
Pozdrowienia
BraZby
www.faq.accdb.pl
www.accdb.pl

BraZby

unread,
Feb 7, 2020, 6:16:42 AM2/7/20
to
W dniu 2020-02-07 o 10:31, BraZby pisze:
Odpowiem sam sobie.
Raczej nie. Być może to Access 2010+.
Jeżeli nie, to raczej nie jestem w stanie Ci pomóc, gdyż Win 10 omijam,
jeśli tylko mogę.


Spróbuj zadeklarować funkcje w poniższy sposób:


#If VBA7 Then
Private Declare PtrSafe Function GetSaveFileName Lib "comdlg32.dll" _
Alias "GetSaveFileNameA" _
(pOpenfilename As OPENFILENAME) As Long
Private Declare PtrSafe Function GetOpenFileName Lib "comdlg32.dll" _
Alias "GetOpenFileNameA" _
(pOpenfilename As OPENFILENAME) As Long

Private Type OPENFILENAME
lStructSize As Long
hwndOwner As LongPtr
hInstance As LongPtr
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As LongPtr
lpfnHook As LongPtr
lpTemplateName As Long
'#if (_WIN32_WINNT >= 0x0500)
pvReserved As LongPtr
dwReserved As Long
FlagsEx As Long
'#endif // (_WIN32_WINNT >= 0x0500)
End Type

#Else
Private Declare Function GetSaveFileName Lib "comdlg32.dll" _
Alias "GetSaveFileNameA" _
(pOpenfilename As OPENFILENAME) As Long
Private Declare Function GetOpenFileName Lib "comdlg32.dll" _
Alias "GetOpenFileNameA" _
(pOpenfilename As OPENFILENAME) As Long

Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As Long
nMaxCustrFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustrData As Long
lpfnHook As Long
lpTemplateName As Long
End Type
#End If

Private Const OFN_ALLOWMULTISELECT = &H200

'--------------------------------------------------------------------------------------------
' otwiera okno dialogowe " Otwórz plik: " lub " Zapisz jako: " - tylko
wybór jednego pliku
' zwraca pełną ścieżkę pliku, po anulowaniu wyboru pliku zwraca ciąg
zerowej długości ""
#If VBA7 Then
Public Function zbDlgSaveOpenFileBis(fSave As Boolean, _
Optional hOwner As LongPtr = 0, _
Optional sTitle As String = "", _
Optional sInitDir As String = "", _
Optional sFilter As String = "", _
Optional lFilterIndex As Long = 0, _
Optional lFlags As Long = 0) As String

#Else
Public Function zbDlgSaveOpenFileBis(fSave As Boolean, _
Optional hOwner As Long = 0, _
Optional sTitle As String = "", _
Optional sInitDir As String = "", _
Optional sFilter As String = "", _
Optional lFilterIndex As Long = 0, _
Optional lFlags As Long = 0) As String
#End If


' Dalej nic nie zmieniaj
'Dim ofn As OPENFILENAME

' itd. itd. .......

Można wyrzucić opcjonalny argument Optional hOwner As Long
i tym samym deklaracja funkcji będzie prostsza, a w funkcji
wpisz:

.hwndOwner = 0 'hOwner

bądź zaremuj powyższą linijkę

Phantom

unread,
Feb 7, 2020, 12:24:52 PM2/7/20
to
Dziękuję
Jest runtime 2000.
Sprawdzę w poniedziałek na komputerze z win10.
Sam również omijam ten system szerokim łukiem... dopóki się da.
Pozdrawiam
Tomek

BraZby

unread,
Feb 8, 2020, 7:02:42 AM2/8/20
to
W dniu 2020-02-07 o 18:24, Phantom pisze:
> Dziękuję
> Jest runtime 2000.
> Sprawdzę w poniedziałek na komputerze z win10.
> Sam również omijam ten system szerokim łukiem... dopóki się da.


Jeśli Access 2000, to raczej nic z tego nie będzie.
Chyba wina leży po stronie Win10.
Obym był złym prorokiem.

Phantom

unread,
Feb 14, 2020, 5:30:34 AM2/14/20
to
Działa, tylko trzeba wyremować to co nie jest dla VB7.
Dzięki.
0 new messages