Information générale
Catégorie:
Codage, syntaxe et commandes
I tried everything I could imagine: the return value is always truncated! It seems to be a bug in VFP. Did anyone succeed to receive a real floating point value from a DLL 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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement