Re: Trying to use DLL (written in C++) in Delphi application
From: Roland Kern (Roland_Kern_at_gmx.de)
Date: 06/25/04
- Previous message: Roland Kern: "Looking for informations to write Delphi (7 or 8) extensions to extend the IDE"
- In reply to: Jim Sawyer: "Trying to use DLL (written in C++) in Delphi application"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Roland Kern: "Looking for informations to write Delphi (7 or 8) extensions to extend the IDE"
- In reply to: Jim Sawyer: "Trying to use DLL (written in C++) in Delphi application"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|