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:
00255871
Views:
25
>If I Replace the BYTE with STRING in VFP, if get the famous Fatal exception error C00005 !, When i use INTEGER, it works but returns wrong values.
>
>Yes the variable names have to be the same as the one in the DLL, it was just a typo.
>
>A Variable Type BYTE in VB is i Think an Integer value from 0 to 255, so why is INTEGER dont work in VFP.
>
An INTEGER type in VFP is 32 bits. You might try SHORT (16 bits), but you'll probably get the same results. 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.

BTW, the only time I've see a DLL function call generate a C5 error is when the value that was passed to a function should have been declared and passed by reference, but the declaration and function passed it by value.
George

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

Click here to load this message in the networking platform