Help Re: error 49 Bad DLL calling convention 
Author Message
 Help Re: error 49 Bad DLL calling convention

I am attempting to use a vc++5.0/win32 compiled C dll/lib
with the a vbasic5.0 program. All calls to the C functions
 from with the vbasic program work  fine when the
 vb application is compiled from within Visual Basic and then
 executed from the dos prompt..however if I attempt to run
 from within visual basic the program returns error 49: Bad
 dll calling convention. The functions in question are defined
  as __declspec( dllimport ) when the C lib is created. For use
  with vb these functions are defined as:

    Declare Function isOpen Lib "d96b32.dll" (ByVal path as String, ByVal
mode as Long ) as Long

 for example.  These library calls also work fine when linked to
 a VC++ application and run from within Visual C++. Can some
 one please explain..why the difference in behaviour when running
 from within Visual Basic as opposed to running the same executable
 from the dos prompt? and also why vb hasn't sense enough to look
 for the dll in the same place as the executable and the vb project
 but rather expects the dll to reside in the vb compilers directory?
 ( the later is not the case, again when the exe is run from the dos
   prompt, from the same directory where the code/exe and vb
   project reside ). What's vb doing differently when it uses the dll
  from a dos prompt than from within vb?

  Any help would be greatly appreciated..
  Thanks,
   Kerry Sanger
   Byte Designs Technical Support



Fri, 25 Aug 2000 03:00:00 GMT  
 Help Re: error 49 Bad DLL calling convention

Quote:

> I am attempting to use a vc++5.0/win32 compiled C dll/lib
> with the a vbasic5.0 program. All calls to the C functions
>  from with the vbasic program work  fine when the
>  vb application is compiled from within visual basic and then
>  executed from the dos prompt..however if I attempt to run
>  from within visual basic the program returns error 49: Bad
>  dll calling convention. The functions in question are defined
>   as __declspec( dllimport ) when the C lib is created. For use
>   with vb these functions are defined as:

>     Declare Function isOpen Lib "d96b32.dll" (ByVal path as String, ByVal
> mode as Long ) as Long

You may need to use the   extern "C"
specifier also, to arrange the calling structure to VB's liking.

- Matt



Fri, 25 Aug 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

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

2. Bad DLL calling convention (error 49)

3. Error 49: Bad Dll Calling convention

4. Error 49 -- Bad DLL Calling Convention

5. error 49 - bad dll calling convention

6. Bad Calling Convention error 49 - due to calling a Sub in a .bas module

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

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

9. RunTime 49: Bad DLL Calling Convention

10. error 49 - Bad DLL callling convention

11. Help! Bad DLL Convention(49)

12. Access200 - Error 49: "Bad DLL calling..."

 

 
Powered by phpBB® Forum Software