[AccessD] 64 Bit Access and comdlg32.dll
Stuart McLachlan
stuart at lexacorp.com.pg
Mon Feb 4 21:20:12 CST 2019
Just remembered thi one as well:
------- Forwarded message follows -------
From: "Stuart McLachlan" <stuart at lexacorp.com.pg>
Organization: Lexacorp
To: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Date sent: Wed, 15 Aug 2018 00:43:27 +1000
Priority: normal
Subject: Re: [AccessD] Need Open File Dialog Box
Send reply to: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Just ran into anotheer wrinkle with PtrSafe and LongPtr two days ago..
One of the test team for an application I am working on has Office
2007 and it spat the dummy on the 32/64 GetFileName() code.
To get it working on A2007 as well as both 32 and 64bit A2010
onwards, I had to use:
#IF VBA7
Declare PTRSAFE Function .......
......LONGPTR.....
#ELSE
Declare Function....
.....LONG......
#END IF
On 4 Feb 2019 at 16:03, Rocky Smolin wrote:
> I had the PtrSafe in there (this was a snip from a web site), but
> LongPtr may do the trick. I forgot about that when trying to make an
> app that runs on both 32 and 64.
>
> Thanks. Hopefully that will do the job. Otherwise you'll be hearing
> from me for more ideas. :)
>
> R
>
>
> -----Original Message-----
> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf
> Of Stuart McLachlan Sent: Monday, February 04, 2019 3:04 PM To: Access
> Developers discussion and problem solving Subject: Re: [AccessD] 64
> Bit Access and comdlg32.dll
>
> You don't have Ptrsafe here:
>
> Private Declare Function GetOpenFileName _
> Lib "COMDLG32.DLL" Alias "GetOpenFileNameA" _
> (pOpenfilename As OPENFILENAME) As Long
>
> Also, you need to modify OPENFILENAME by changing LONG to LONGPTR for
>
> hWndOwner and hInstance since they are handles.
>
>
> On 4 Feb 2019 at 9:32, Rocky Smolin wrote:
>
> > Dear List:
> > I have two apps which need to operate in both 32 and 64 bit Office
> > environments.
>
> > I have added PrtSafe to all of the declares and that part works.
>
> > However, the Open File Dialog box does not. It calls the standard:
>
> > Private Declare Function GetOpenFileName _
> >
> > Lib "COMDLG32.DLL" Alias "GetOpenFileNameA" _
> >
> > (pOpenfilename As OPENFILENAME) As Long
>
> > But the dialog box does not open. Control simply transfers to the
> > next line of code after the Call to GetOpenFileName.
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
More information about the AccessD
mailing list