Solved

Class in Dll

Posted on 1997-05-23
2
964 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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

11 Experts available now in Live!

Get 1:1 Help Now