|
|
Using pointers: CODE Private Declare PtrSafe Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
ByVal Destination As LongPtr, _ ByVal Source As LongPtr, _ ByVal Length As LongPtr _ ) Using object/variable references: CODE Private Declare PtrSafe Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
Destination As Any, _ Source As Any, _ ByVal Length As LongPtr _ ) To achieve type safety (String & Long used as an example; could be any other data types): CODE Private Declare PtrSafe Sub LongToString Lib "kernel32" Alias "RtlMoveMemory" ( _
ByVal Destination As String, _ Source As Long, _ ByVal Length As LongPtr _ ) NOTE: The code reflects a possible number(s) of declarations. Depending on your specific needs, you may want different syntax. For details on how to declare an API procedure, consult API article. For pre-VBA7 (pre-Access 2010) compatible syntax, there are several sites that already documents the same API in more details. ALLAPI at mentalis.org is one such resource. MSDN Reference: MoveMemory
|
| This page has been accessed 1,258 times. This page was last modified 14:45, 22 May 2011 by BananaRepublic. Disclaimers |