Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C++Builder based dll library: how to import to Delphi?

Status
Not open for further replies.

erft

Programmer
Aug 18, 2004
2
0
0
PL
Dear All,

perhaps you have some experience in the following matter:
I've designed a simple dll library using BC++Builder. It is obviously written in C++. Now, I want it to become a part of larger project that is written in Delphi.
Unfortunately Delphi's compiler says it cannot find functions that are within my dll.
Do you know how should I modify my dll in order to import it to Delphi project?

Thank you in advance.
 
use cdecl in the interface declaration.
use a underscore on start of the name.
check the names case sensitivity
i.e.
Code:
interface
function _MyFunction(pszName: PChar): Boolean;cdecl;

implementation
function _MyFunction(pszName: PChar): Boolean;cdecl;external 'Mydll.dll';
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top