Article View: pl.comp.bazy-danych.msaccess
Article #137677Re: Uruchamianie Eksploratora windows
From: BraZby
Date: Fri, 07 Feb 2020 11:15
Date: Fri, 07 Feb 2020 11:15
142 lines
5900 bytes
5900 bytes
W dniu 2020-02-07 o 10:31, BraZby pisze:
> W dniu 2020-02-05 o 10:24, Phantom pisze:
>> 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.
>
> A czy przypadkiem MS Access jest w wersji 64-bitowej?
>
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ę
--
Pozdrowienia
BraZby
www.faq.accdb.pl
www.accdb.pl
Technical Details
Message-ID:
<5e3d46f4$0$508$65785112@news.neostrada.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!border2.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-b-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mailReferences:
<7b5381dc-fe18-4be3-bc8c-a73243ddc310@googlegroups.com> <5e3d2e88$0$536$65785112@news.neostrada.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!border2.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-b-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail Subject: Re: Uruchamianie Eksploratora windows Newsgroups: pl.comp.bazy-danych.msaccess References: <7b5381dc-fe18-4be3-bc8c-a73243ddc310@googlegroups.com> <5e3d2e88$0$536$65785112@news.neostrada.pl> From: BraZby <byle@co.pl> Date: Fri, 7 Feb 2020 12:15:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <5e3d2e88$0$536$65785112@news.neostrada.pl> Lines: 143 Message-ID: <5e3d46f4$0$508$65785112@news.neostrada.pl> Organization: Telekomunikacja Polska NNTP-Posting-Host: 5.172.235.69 X-Trace: 1581074164 unt-rea-b-01.news.neostrada.pl 508 5.172.235.69:11039 X-Complaints-To: abuse@news.neostrada.pl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit