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.
Can anyone tell me how can i use it in delphi 2.0?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 'ExportedNameOfCreateAnObj ect';
Regards,
Erik.
Import it into delphi like this:
function CreateAnObject : POINTER; stdcall; external 'DLLNAME.DLL' name 'ExportedNameOfCreateAnObj
Regards,
Erik.
ASKER
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.