Bad Dll Calling Convention??? 
Author Message
 Bad Dll Calling Convention???

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.
???????
David



Sat, 01 Apr 2000 03:00:00 GMT  
 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)



Sat, 01 Apr 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. 2 PRBS: Calling 16 bit DLL from VB5 and Bad DLL Calling Convention

2. 16bit->32bit C dll : bad dll calling convention

3. Bad DLL calling convention VB-to-C DLL

4. C DLL (VC5) and Bad DLL Calling Convention

5. Bad DLL Calling Convention with CPUINF32.DLL

6. Possible answer to Err 49: Bad DLL calling convention

7. Run-time error '49': Bad DLL calling convention

8. Possible answer to Err 49: Bad DLL calling convention

9. VB Error: "Bad DLL Calling Convention"

10. Bad DLL calling convention (error 49)

11. "Bad DLL Calling Convention"

12. Error 49: Bad Dll Calling convention

 

 
Powered by phpBB® Forum Software