Solved

Class in Dll

Posted on 1997-05-23
2
967 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

792 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