Link to home
Start Free TrialLog in
Avatar of sheslop
sheslop

asked on

calling a dll function that receives/returns a double from VB

hello,

im trying to pass a double type to a dll function that returns a double in VB. i get the error "bad Dll naming convention".

heres the VB function declaration:

Declare Function fnCPS_DateFormat Lib "CPS_DateFormat.dll" Alias "_fnCPS_DateFormat@8" (dblDate As Double) As Double

and heres the C++ function declaration:
extern "C" __declspec(dllexport) double WINAPI fnCPS_DateFormat(double dblDateDiff);

if the types are changed to int it works fine. is there something i need to do for i to work with doubles (pretty much 64 bit signed integers)
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
However, I did not test that against VB.  -- Dan
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
********************************************************************************************
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Split between [DanRollins] and [Salte]
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Axter
EE Cleanup Volunteer
********************************************************************************************