Link to home
Start Free TrialLog in
Avatar of Nuno Alves
Nuno Alves

asked on

Classes in Dll

I have a class build in c++ in a Dll.
Can anyone tell me how can i use it in delphi 2.0?
Thank you.

ASKER CERTIFIED SOLUTION
Avatar of sperling
sperling

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nuno Alves
Nuno Alves

ASKER

How can I load the dll in delphi?
I now that with the dll in C I just have to put before
the declaration of the function external 'Dll name' but
with the class i couldn't do the same.
You have to declare an exported function in the C DLL. This function should create an instance of the class and return it as a pointer. I can't be of much help when it comes to C syntax...

Import it into delphi like this:

function CreateAnObject : POINTER; stdcall; external 'DLLNAME.DLL' name 'ExportedNameOfCreateAnObject';


Regards,

Erik.