Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return (floats / SINGLE/ DOUBLE) from an API
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00039147
Message ID:
00039157
Views:
34
>Using VFP 5.0, we are calling a function in a DLL that we wrote. The function in C++ returns a float. We have tried to declare it as first SINGLE and the DOUBLE. In both cases, the function was called, it returned a floating point number (checked from the debugger). It both cases, the return value was truncated to an integer. Does anyone have an idea what I'm not doing correctly?
>
>in VFP
>DECLARE DOUBLE AQuAGetLineHeight IN AQuA_Lib INTEGER nInstanceID
>nLineHeight = AQuAGetLineHeight(1)
>wait window str(nLineHeight,10,3)
>
>in C++
>float FAR PASCAL EXPORT AQuAGetLineHeight(long nInstanceID)
>{
> AFX_MANAGE_STATE(AfxGetStaticModuleState());
> // normal function body here
> return(2.2345);
>}
>
>The wait iwndow shows 2.000.
>
>Thanks,
>Karen Lahey

local nLineHeight
nLineHeight = 0.00000
Previous
Reply
Map
View

Click here to load this message in the networking platform