Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a memcpy Win32API?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00060493
Message ID:
00060538
Views:
22
>BACKGROUND
>
>I have been using the Lotus Orgainizer 97 API in FoxPro with much success until recently. There is Organizer API function that returns a pointer (integer) to a memory location. Another Organizer API function is to be used to copy the memory at that pointer to a buffer. Unfortanately, I cannot get the VFP to recognize the API function. It gives me an error to the effect saying it cannot find the entry point in the DLL.
>
>There is a sample function call in Visual Basic. It uses the CALL statement to invoke the API function. The API function is declared in VB as such:
>
>Declare Sub hmemcpy Lib "OrgAPI32" Alias "OrgAPImemcpy" (...)
>
>QUESTIONS
>
>How do I DECLARE an API function in VFP to mimick the Declare Sub in Visual Basic? If this is not posible, is there a Windows API to do a memcpy? This API function would have to except an integer addrress as the source and character string as the destination. I tried using the Win32API function lstrcpyn with no success. It did not give me an error, but the destination string contained garbage.
>
>Thanks!

Timothy,

Oops, I had that backwards, try:

DECLARE INTEGER lstrcpy IN Win32API;
STRING @lpString1, INTEGER lpString2

The other way copies the buffer to the string address. Sorry.

Vlad, to answer your question, the string pointed to (lpstring2) should be NULL terminated. In other words, CHR(0) will be the last character copied.

George
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform