PInvoke question (caling conventions of C DLLs)



I want to call functions in a Win32 DLL from VB. The DLL in question, is the Python DLL (python25.dll).

I have noticed something strange. When I declare the functions in VB6 (i.e. VB classic), I get an error : "Bad DLL calling convention" - yet when I run the same code through VB.Net, the code works fine - my assumption is that VB.Net can make calls to C functions using either the __stdcall OR __cdecl, whereas VB6 requires the __stdcall calling convention.

This is just a hunch - does anyone know the technical reason for this behaviour?
.



Relevant Pages

  • Re: Something strange (?) with abstract base class
    ... I've just found something strange with some of my classes. ... strictly MFC, but I'm pretty sure someone can help me. ... say CBase, and several derived classes, say CDer1, CDer2, etc. They're ... none of these classes, or anything inside them, is exported in the DLL ...
    (microsoft.public.vc.mfc)
  • Something strange (?) with abstract base class
    ... I've just found something strange with some of my classes. ... strictly MFC, but I'm pretty sure someone can help me. ... say CBase, and several derived classes, say CDer1, CDer2, etc. They're ... none of these classes, or anything inside them, is exported in the DLL ...
    (microsoft.public.vc.mfc)
  • MFC DLL class problem...very strange!
    ... here is the (strange!) situation. ... first test in an exe. ... to export them to an MFC DLL. ... an object pointer as part of the IOCP. ...
    (microsoft.public.vc.mfc)
  • Inconsistency in exported symbols between different compiler versions
    ... I have a library (a DLL) and that lib exports a type. ... The exact same setup compiles and runs under VC7.1. ... This is really strange, it seems as if the additional ...
    (microsoft.public.vc.language)
  • Re: Bug in LoadLibrary when dot in path spec under Windows XP?
    ... yeah, this is really interesting, seems this is really an MS bug. ... really strange, I thought the only thing that MS changed for XP is ... > BOOL APIENTRY DllMain(HANDLE hModule, ... I do nothing fancy in that DLL. ...
    (microsoft.public.win32.programmer.kernel)