[AccessD] GetOpenFileName vs. Windows 7

Stuart McLachlan stuart at lexacorp.com.pg
Wed Jan 26 17:18:14 CST 2011


Sorry, that was off the top of my head and I got things mixed up. I've been doing quite a bit of 
multithreading recently and had thread safe functions on the brain.

I should have said PTRSAFE  which is required if you are calling APIs from x64 Access 2010 
( in my case, the workstations using Office 10 x64 are running Windows 7 x64)

Because of mixed OS/Office versions wth many clients  I still develop in 2003  and distribute 
MDB/MDEs.   (that and the fact that I hate the development environment in A2007+)

A typical  declaration not looks like this

#If VBA7 Then         'Access 2010 - allow for 64 bit
    Declare PtrSafe Function GetOpenFileName Lib "comdlg32.dll" Alias _
        "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
#Else                        'earlier version of Access.
    Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
        "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
#End If


Here's a good primer on the subject:
 http://www.jkp-ads.com/articles/apideclarations.asp

-- 
Stuart



On 26 Jan 2011 at 17:13, Arthur Fuller wrote:

> Where in the declaration does THREADSAFE go?
> 
> Thanks,
> Arthur
> 
> On Wed, Jan 26, 2011 at 4:59 PM, Stuart McLachlan
> <stuart at lexacorp.com.pg>wrote:
> 
> > I'm currently using the GetOpenFilenameAPI on 64 bit Win7 from
> > Access without any problems.  (You just have to put the word
> > THREADSAFE in the function declaration).
> >
> > Note that I do quite a bit of work with API calls.  I never use .Net
> > framework calls.  Basically they are just wrappers to the API which
> > is still there.
> >
> > --
> > Stuart
> >
> -- 
> 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