At 02:42 PM 6/25/2005 , Rui Fernandes wrote:
I keep trying to use GSL's dlls with VB6. I'm declaring some test
functions like this
Public Declare Function gsl_acosh Lib "libgsl.dll" (ByVal x As Double)
but it gives the error: "Bad DLL calling convention" ( error 49 ) when I
call it like
Dim a As Double
a = gsl_acosh(0.2)
Does anyone knows what is wrong here? The debug gives the error on the
"a=gsl_...". It finds the function, but it doesn't work.
Most likely the exported functions have the cdecl calling convention. VB
expects the stdcall calling convention. If the DLL doesn't export stdcall
versions of the function, you could do one of two things:
1. Modify the source to change the calling convention of the exported
functions and recompile a custom version for your own use.
2. Modify the source to add stdcall wrappers for the functions you need.
3. Write a separate DLL that exports stdcall functions and acts as a proxy
for libgsl.dll.
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
GnuWin32-Users mailing list
GnuWin32-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuwin32-users