Click to See Complete Forum and Search --> : more DLL issues...
crptcblade
Feb 21st, 2001, 05:56 PM
What is the equivalent to a float in VB, because I'm getting an error like "Bad DLL calling convention", or something like that, and I think that the data type maybe the problem...also, what else could it be besides the data type, any ideas??
parksie
Feb 21st, 2001, 06:20 PM
C/C++ - VB
char - byte
short - integer
int - long
long - long
float - single
double - double
Also, you need to make sure that you're using the __stdcall (two underscores) calling convention.
crptcblade
Feb 21st, 2001, 07:03 PM
Doh, that would probably do it too, huh? thanks Mike.
crptcblade
Feb 21st, 2001, 11:38 PM
could you give me an example of what I'm supposed to do, I'm just getting back into C++ and the MSDN is confusing the hell outta me. Like some thing simple, a function that takes in two floats, and adds them and returns the result. With all the prototyping(is that what its called?) and all, so it would theoretically work in VB...thanks for your time and help...
parksie
Feb 22nd, 2001, 05:26 AM
mydll.cpp
float __stdcall myfunc(float input, float other) {
return input + other;
}
mydll.def
LIBRARY "mydll.dll"
EXPORTS
myfunc
Prototyping is only needed for C++, and only for compile-time dynamic linking.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.