
Bad Dll Calling Convention???
Quote:
>I'm calling f_map_open from vb to a C DLL. f_map_open has (hwnd wind, path)
>as it s arguements. I called it like this:
>dim wind as long
>dim path as string
>dim retval as long
>retval=Map_Open(wind, path)
>*note Map_OPen is how I declared it.
>VB tells me this is a bad dll calling convention, but I can't see what's
>wrong with it.
The most common reason is the C function uses the default _cdecl calling
convention, rather than the preferred _stdcall calling convention.
Make an EXE file and see if the DLL can be called without error. If
there is no error, the culprit is the calling convention. The IDE demands
the _stdcall convention.
--
Henry S. Takeuchi
Seattle, Washington (USA)