Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB Call to API vs VFP
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00255827
Message ID:
00256518
Views:
23
>Hi George,
>
>>The reason I suggested a STRING is that a normal (not Unicode) one character string contains 8 bits which is the size of a BYTE. However, VFP may include a null terminator on the string (CHR(0)) which may be causing the problems you're seeing.
>
>But a string is always passed as a pointer? How should an additional byte at the memory address cause a GPF?
>
Hi Christof,

One more thought. Are you sure that a string is always passed by reference? I don't think so. Try this, declare GetProfileString() and don't declare the return buffer as being passed by reference, and don't pass it that way. The return value will indicate that characters have been written to the buffer, but the string will be empty on return. You have to explicitly declare it that way, once you do and pass it by reference, you get the same return value, and that many characters in the string.
George

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

Click here to load this message in the networking platform