Re: Trying to use DLL (written in C++) in Delphi application

From: Roland Kern (Roland_Kern_at_gmx.de)
Date: 06/25/04


Date: Fri, 25 Jun 2004 19:00:14 +0200

Hi Jim,

if you want to call functions of a C++ DLL from a Delphi
program you must declare the Dll functions as extern "C".
The result is, that the functionname is not decorated
and you can call the function like a normal C function.

best regards,

Roland Kern

p.s.: I hope you can understand my "not so good" english?

>> "Jim Sawyer" <nospam@myaddress.info> schrieb im Newsbeitrag
news:o_udncIpZvwzUE7dRVn->> gw@comcast.com...
>> Using D7.

>> I need to use a DLL file written in C++ (file of functions necessary for
me
>> to receive data from a specific piece of lab equipment) in a Delphi
>> application. I have no idea how to declare the DLL file or how to
declare
>> the functions in that file so that I can use them in the Delphi app. Can
>> someone please give me some example code?
>>
>> A sample function from the TestBest.DLL spec is:
>>
>> - OpenPort function
>> Returns integer which represents a member of the enumeration INIT_STATUS.

>> syntax
>> object.OpenPort( PortName )

>> part description

>> PortName String representing the name of the COM port to be
opened; e.g. "COM1". Valid >> ranges are in the range "COM1" to "COM99",
but must represent actual ports on the computer.

>> Thanks,
>> Jim Sawyer
>> DataWare



Relevant Pages

  • DLL / Update without restarting Web Service?
    ... I have setup a website which uses an old DLL file ... this update WITHOUT resetting the W3SVC service. ... Is there a way to us the Delphi DLL as a COM or COM+ component? ...
    (microsoft.public.inetserver.iis)
  • problem with loading dll programmed by Delphi7
    ... In the VB.NET2005 I declared the function as 'Declare Auto Function GetStr ... Lib "Delphi.dll" (ByVal s As String) As String', but I would run into the ... But I tested the dll within Delphi application, ...
    (microsoft.public.dotnet.general)
  • Re: Loading and Unloading Unmanaged DLLs
    ... >I'm using a 3rd party DLL for operating on SNMPv3 machines. ... >But i'm coming up with a problem that when I declare a DLL ("declare ... VB.NET was designed by the Delphi designer ... >I've also noticed that the debug app is wrapped under the vb6.exe ...
    (microsoft.public.vb.winapi)
  • 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)