Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting a VB DLL declaration and function
Message
 
 
To
19/04/2007 07:30:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01217662
Message ID:
01217668
Views:
7
Hi Jos,

The RtlMoveMemory can be declared in many ways depending on what parameters are. Can you give more info about what you are trying to copy, preferebly with VFP code showing source of data to copy?
You can also check Heap allocation class File #9482 for existing declarations. maybe one fits your requirement.

>
>I'm struggling with trying to convert a bit of VB code to VFP. The VB code has this DLL declaration:
>
>
>Private Declare Sub RtlMoveMemory Lib "kernel32" 
(ByVal hpvDest As Any, ByVal hpvSource As Any, ByVal nBytes As Long)
>
>
>I have translated this declare into:
>
>
>DECLARE INTEGER RtlMoveMemory IN KERNEL32.DLL ;
>  STRING hpvDest, ;
>  LONG hpvSource, ;
>  LONG nBytes
>
>
>Then the VB code calls this function as follows:
>
>
>Dim bytePhrase(500) As Byte
>*'Store the string pointer as a byte in the bytePhrase array
>RtlMoveMemory VarPtr(bytePhrase(0)), lngStrAddress, 500
>*'Convert from a byte to string
>ByteToString = StrConv(bytePhrase, vbUnicode)
>
>
>Where lngStrAddress is a pointer to a memory address which contains some text as single-byte or double-byte characters. eg lngStrAddress = 165270112.
>
>The VB code above uses the RtlMoveMemory call to get at the data contained at this address and convert it using VarPtr() and StrConv() to a string but I cannot seem to make that work in VFP :/
>
>Anybody know what to do?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform