Solved

Class in Dll

Posted on 1997-05-23
2
965 Views
Last Modified: 2008-03-06
I have a C++ class in a dll and i want to use it in Delphi.
I asked help before about this subject and someone told me that i need a function in the dll to get a pointer to the class. I've tryed many things and my Delphi application still crushing. Can anyone tell me how is this function.
Thanks.
0
Comment
Question by:Nuno Alves
2 Comments
 

Accepted Solution

by:
Charlie V earned 20 total points
ID: 1336561
you have to declare the function in the INTERFACE part of the Unit
and before in de IMPLEMENTATION part of the unit
write with the parameter of EXTERNAL and the name of  the DLL
for example I use this in my proyect in Delphi

unit TheUnitMain;

INTERFACE
uses  ....

// this is the procedure to import from DLL
procedure LoadAboutbox(Handle: THandle; AppName: ShortString);

type ...

IMPLEMENTATION

procedure LoadAboutbox; external 'AboutDLL' ;

try this and I hope works with your proyect.
0
 
LVL 1

Author Comment

by:Nuno Alves
ID: 1336562
What I need is the function in C to put in the Dll to get a
pointer to the class, not the code in Delphi.
Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi custom sort exception 6 136
Virtuailstring tree compare node issue 14 105
error 1.1 400 Bad request idhttp delphi 18 55
tvirtualstringtree freeze when load too manny images 10 52
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now