Re: PInvoke question (caling conventions of C DLLs)



On Nov 14, 5:01 pm, Anonymous <no.re...@xxxxxxxx> wrote:
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?

..NET can support __cdecl functions.

--
Tom Shelton

.



Relevant Pages

  • Re: PInvoke question (caling conventions of C DLLs)
    ... "Anonymous" schrieb ... is the Python DLL. ... I have noticed something strange. ... When I declare the functions in ...
    (microsoft.public.dotnet.languages.vb)
  • Re: PInvoke question (caling conventions of C DLLs)
    ... Tom Shelton wrote: ... I have noticed something strange. ... When I declare the functions in VB6 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: New To Visual Basic 2005
    ... solve is several of my API declares uses Any, ... Declare Function FormatMessage Lib "kernel32" Alias ... hehe my VB6 is probably about as good as your VB .NET. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Please help translate that from C#
    ... In VB6, if cSkype were a class, couldn't you declare the ... object at module level using Withevents? ... The problem is that they are suggesting adding an event handler delegate, ...
    (microsoft.public.vb.general.discussion)
  • Re: Help! How do I get the SSID of my connection?
    ... I have been unable to find any code I can use in VB6 however. ... Now put Option Explicit back into the module and declare your variables. ... Larry Lard ...
    (microsoft.public.vb.general.discussion)