#BAD DLL CALLING CONVENT.
2 messages in this thread
Jonathan,
You are correct, I am writing the DLL in Borland 'C++'. When you say that
VB sends the address of a double as a hidden parameter, are you saying that
part of the address of a double is in the parameter being passed to the dll
and the other on the stack? Or are you saying that the function call in
the DLL should handle variable parameters (…).
Is this side effect caused by the fact that doubles are 64 bit
numbers and the address space is only 32 bits ?
Using the following VB Declare statement and cooresponding 'C'
prototype how do you propose to obtain the value of the double type from
VB?
Thanks Al
Microsoft VB Declaration:
————————-
Declare Function BCDToReal Lib "math.DLL" (ByVal BCDNumber$) As Double
Borland 'C' Declaration:
————————
double FAR PASCAL BCDToReal( char far *BCDNumber )
There is 1 Reply.
Alfred,
It is not really a variable number of parameters, just one extra
that will always be appended to a function returning a DOUBLE:
Borland Decl:
*double FAR PASCAL BCDToReal (char far *BCDNumber, double far *Result)
*Result = 27.3 (or whatever);
Return *Result;
Something like that. I have been away from BC++ for a while. does this
make sense? You will be passed the address of a pre-created DOUBLE as the
final parameter on the stack and you fill that variable and return that
address as your function result. -=- Jonathan