Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing strings to DLL
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00588408
Message ID:
00591245
Views:
37
>>The string passed in VFP is a 32-bit pointer to a fixed-length array of char, whose exact length is LEN(string variable state when passed). <
>
>If you pass this 4 byte pointer to a function in DLL and that function changes the string value and/or length withour moving it in the memory, then VFP can receive back the value for this string. How VFP moves the string later doesn't matter. Otherwise what is the meaning of passing variables by reference if they cannot be altered?

You can alter the content, not the length. You cannot count on the location in memory remaining the same, so self-referential absolute pointers will become invalid. There are approaches to get around this; one is my ClsHeap class. Rent a clue - download it and read the code.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform