🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8748

Re: calling host executable functions/methods from a dll

#8748
From: Remy Lebeau (TeamB)
Date: Wed, 22 Sep 2004 17:54
24 lines
1676 bytes
<Roger Warren> wrote in message news:41516f76@newsgroups.borland.com...

> hi, how can i call a host executables methods or functions from
> a dll that is loaded dynamically (using LoadLibrary() and
GetProcAddress())?

Two ways:

1) have the host export the functions just like a DLL would, and then the
DLL can use GetProcAddress() to get to them

2) have the host pass the desired function pointers to the DLL as parameters
to a function that the DLL exports, and then the DLL can store them for use
whenever it needs to call them.

> if i have TForm1 *Form1 in the host executable, can i pass
> a pointer to an instance of TForm1 to the dll?

Yes, although I would not advise passing VCL objects over the DLL boundary
unless you are making a package instead of a DLL.


Gambit
Technical Details
Message-ID: <4151bc0a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41516f76@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,61cd17292f50f8cb
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <41516f76@newsgroups.borland.com>
Subject: Re: calling host executable functions/methods from a dll
Date: Wed, 22 Sep 2004 10:54:08 -0700
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <4151bc0a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1095875594 68.69.17.41 (22 Sep 2004 10:53:14 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail