[AccessD] DECLARE and SafePtr

Jim Dettman jimdettman at verizon.net
Mon Oct 25 06:12:04 CDT 2021


<< I will say that I
have run into many APIs that he does not cover though.>>

 Some he does not, but some he does.    

 And besides the file that Borge pointed to, there is also:

http://msdn.microsoft.com/en-us/library/aa383663(VS.85).aspx

 Which are the new 64 bit calls for Windows.

 Also, if you want the article on compiler constants, PtrSafe etc straight
from Microsoft, it's:

Compatibility Between the 32-bit and 64-bit Versions of Office 2010
http://msdn.microsoft.com/en-us/library/ee691831(office.14).aspx

Look at the section "Introducing the VBA 7 Code Base"

I think Phillip did a better job of it, but it is a re-hash of what's in the
MSKB article.

The links are from an EE question I answered back in 2011:

https://www.experts-exchange.com/questions/27190589/GetUserName-fails-on-64b
it-Access.html

  Don't know that it's worth the read, but it does go into the VBA compiler
constants a bit, which are quite confusing to use at first.

Jim.

-----Original Message-----
From: AccessD On Behalf Of Bill Benson
Sent: Monday, October 25, 2021 6:31 AM
To: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
Cc: Jim Dettman <jimdettman at verizon.net>
Subject: Re: [AccessD] DECLARE and SafePtr

Thanks Jim for mentioning JKP's site before I could... I will say that I
have run into many APIs that he does not cover though. I look forward to
exploring the file Borge mentioned for things I have had to mess around
with in the past.

One of the most difficult things I have had to deal with are things like
strPtr and AddressOf. And still have not a clue how I made things work or
if I could do it again were a gun or even Arthur's Excalibur held to my
head.

On Sat, Oct 23, 2021 at 8:52 AM Jim Dettman via AccessD <
accessd at databaseadvisors.com> wrote:

>
>  Arthur,
>
>    You should give this page a read:
>
>
>
>
https://codekabinett.com/rdumps.php?Lang=2&targetDoc=windows-api-declaration
> -vba-64-bit
>
<https://codekabinett.com/rdumps.php?Lang=2&targetDoc=windows-api-declaratio
n-vba-64-bit>
>
>
>  as it explains about the compiler constants and when you might use them,
> along with LongLong, LongPrt, and PtrSafe
>
>  and besides the file that Borge mentioned, there is a good reference
here:
>
>
> https://jkp-ads.com/articles/apideclarations.asp
>
>  with the correct syntax.
>
> Jim.
>
> -----Original Message-----
> From: AccessD On Behalf Of Borge Hansen
> Sent: Saturday, October 23, 2021 1:12 AM
> To: Access Developers discussion and problem solving
> <accessd at databaseadvisors.com>
> Subject: Re: [AccessD] DECLARE and SafePtr
>
> Hi Arthur,
> I've been following your thread re upgrading your Access app from 32bit to
> 64bit.
> I went through the exercise earlier this year.
> I recommend that you have both a 32bit and 64bit version of your Office
> running (on two different machines or VMs of course) to test that the app
> will run both on 32bit version of Office and 64bit version. Your client
may
> have a mix of 32bit and 64bit Office.
> If you  have any third party DLLs - or similar - that your app is
dependent
> on, make sure that a 64bit version is available.
>
> I used this file:
> Win32API_PtrSafe.TXT
> to help me with the conversion.
> I would search in our vba code for all instances of
> Lib "Kernel32"
> and then copy and paste and search for the specific Declare Function in
the
> TXT file, (I would use Sublime Text for searching the .TXT file).
> Then copy and paste the whole Declare PtrSafe Function over the existing
> Declare ...  Lib "Kernel32" function.
> In only a few instances did I need to include testing - doing a
> #If Win64 then
> - and include the two different Lib "Kernel32" functions...
>
> You can download the
> Win32API_PtrSafe.TXT
> from here:
>
>
https://docs.microsoft.com/en-us/office/troubleshoot/office-suite-issues/win
> 32api_ptrsafe-with-64-bit-support
>
<https://docs.microsoft.com/en-us/office/troubleshoot/office-suite-issues/wi
n32api_ptrsafe-with-64-bit-support>
>
> Hope  this helps...
>
> /borge
>
>
>
> On Sat, Oct 23, 2021 at 12:12 PM Arthur Fuller <fuller.artful at gmail.com>
> wrote:
>
> > What s the syntax for such a Declare statement/
> >
> > --
> > Arthur
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
-- 
AccessD mailing list
AccessD at databaseadvisors.com
https://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list