Re: Calling C++ DLL from VB

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ralph (msnews.20.nt_consulting32_at_spamgourmet.com)
Date: 02/14/05


Date: Mon, 14 Feb 2005 07:56:50 -0600


"Peter Aitken" <paitken@CRAPnc.rr.com> wrote in message
news:e9ZQpopEFHA.2180@TK2MSFTNGP12.phx.gbl...
> I am trying to call functions in a DLL that is supplied by a hardware
> manufacturer. In a C++ program everything works just fine. In VB however
> there is a problem - the program cannot find the entry point in the DLL. I
> declare the function as usual:
>
> Public Declare Function fdOpen lib "fglove.dll" (port As String) As Long
>
> But when I call the function I get this error:
>
> Run Time Error 453 - cannot find entry point fdOpen in fglove.dll
>
> I have double-checked the spelling and capitalization of the function
name.
> Any ideas how I can fix this?
>
> Thanks
>
> --
> Peter Aitken
>
> Remove the crap from my email address before using.
>

You say it works fine in C++?

Post the declaration in the header file you use to compile your C++
application.
It is possible the function is not _stdcall. Also I suspect it would be
interesting to see how that "String" was declared.

-ralph



Relevant Pages

  • Re: Unsigned 32 bit
    ... This helper dll has the base adress 0x02400000. ... Its equivalent VB declare is ... Dim MyVar As Long, AdressOfMyVar1 As Long, AdressOfMyVar2 As Long ... Both project internal adresses are inside the jump table VB has build. ...
    (microsoft.public.vb.general.discussion)
  • Re: Unsigned 32 bit
    ... > For this helper dll I wrote a typelib in IDL called ukVBHLB.tlb. ... Its equivalent VB declare is ... > Both project internal adresses are inside the jump table VB has build. ...
    (microsoft.public.vb.general.discussion)
  • Re: Converting VB6 Structures to .NET
    ... This dll was written by a third party ... I will try ByRef. ... I am using a number of "Declare Function" statments to access the functions ... Public Structure zFuheader ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Exported function mangaled name
    ... that header file; it must be declared as __declspec ... You have to declare the function the same way in your .cpp file as in ... #define LIBSPEC __declspec ... See my essay on The Ultimate DLL Header File on my MVP Tips site. ...
    (microsoft.public.vc.mfc)
  • Re: Calling C++ DLL from VB
    ... > I am trying to call functions in a DLL that is supplied by a hardware ... > there is a problem - the program cannot find the entry point in the DLL. ... > declare the function as usual: ... Post the declaration in the header file you use to compile your C++ ...
    (microsoft.public.vb.general.discussion)