?
Solved

Class in Dll

Posted on 1997-05-23
2
Medium Priority
?
971 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 40 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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

752 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