ChrisO
Registered User.
- Local time
- Today, 18:07
- Joined
- Apr 30, 2003
- Messages
- 3,202
As Any in 64 bit systems.
In the following API call does As Any also translate to a 64 bit system?
An extract from a Microsoft article at:- http://msdn.microsoft.com/en-us/library/office/aa165080(v=office.10).aspx
“Some DLL functions have arguments that can take different data types. The VBA Declare statements for these functions define these arguments as type Any. Calling a DLL function with arguments declared as Any can be perilous, because VBA does not perform any data type checking for you. If you want to avoid the hazards of passing arguments as Any, you can declare multiple versions of the same DLL function, each with a different name and a different data type.”
So, if the compile of the above API call is controlled by a 32/64 bit compiler directive, does the As Any get converted to the correct data type and length?
PtrSafe and Long to LongLong seem to be known but is As Any known? I can find nothing which specifically relates to the difference between As Any in a 32 bit system as opposed to a 64 bit system.
I think it needs testing but I can’t test it. I also think that, if it fails, it will fail very quickly.
Regards,
Chris.
In the following API call does As Any also translate to a 64 bit system?
Code:
Private Declare Sub RtlMoveMemory Lib "kernel32" (ByRef Destination As Any, _
ByRef Source As Any, _
ByVal Length As Long)
An extract from a Microsoft article at:- http://msdn.microsoft.com/en-us/library/office/aa165080(v=office.10).aspx
“Some DLL functions have arguments that can take different data types. The VBA Declare statements for these functions define these arguments as type Any. Calling a DLL function with arguments declared as Any can be perilous, because VBA does not perform any data type checking for you. If you want to avoid the hazards of passing arguments as Any, you can declare multiple versions of the same DLL function, each with a different name and a different data type.”
So, if the compile of the above API call is controlled by a 32/64 bit compiler directive, does the As Any get converted to the correct data type and length?
PtrSafe and Long to LongLong seem to be known but is As Any known? I can find nothing which specifically relates to the difference between As Any in a 32 bit system as opposed to a 64 bit system.
I think it needs testing but I can’t test it. I also think that, if it fails, it will fail very quickly.
Regards,
Chris.