Solved

Class in Dll

Posted on 1997-05-23
2
969 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

695 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