Re: PInvoke question (caling conventions of C DLLs)



"Anonymous" <no.reply@xxxxxxxx> schrieb
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?

Probably you didn't change the declaration to fit the language. Integers:

16 bit: VB6=Integer; VB.Net=Short
32 bit: VB6=Long; VB.Net=Integer
64 bit: VB6=not available; VB.Net=Long


Armin
.



Relevant Pages

  • Re: PInvoke question (caling conventions of C DLLs)
    ... the Python DLL. ... I have noticed something strange. ... When I declare the functions in VB6 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: [opensuse] Whats all about
    ... Rajko M. schrieb: ... I checked the same as you and whois output is only concord.org record. ... The strange thing is that I always edit it. ...
    (SuSE)
  • Re: "my" variables and recursive regexp strangeness
    ... > I have something strange happening with a recursive regexp compiled ... > It works fine when the sub parts of it are global variables, ... to declare the variables in the same statement that uses them, ...
    (comp.lang.perl.misc)
  • DBD::Sybase with MS SQL insert problem
    ... so I'm stuck with the kluge described ... I'm seeing a strange result after executing the following query: ... DECLARE \@siteurl sc_url ...
    (perl.dbi.users)
  • Re: converting a date format
    ... "Cor Ligthert" schrieb: ... strange with you read as well the rest. ... even if the Mondo patch is installed. ...
    (microsoft.public.dotnet.languages.vb)