Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return (floats / SINGLE/ DOUBLE) from an API
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00039147
Message ID:
00039361
Vues:
38
I don't think you need to declare FAR PASCAL your function.

Vlad

>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform