🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Load DLL Class dynamic

#13833
From: Andrue Cope
Date: Wed, 17 Sep 2003 08:37
22 lines
2049 bytes
Andreas Osswald,

> Is it possible to load an Class dynamic out of an DLL. Functions i load with
> GetProcAdress() but how is it with Classes. Any suggestion ?
>

It is possible but not generally recommended. The problem is that it will very 
likely limit your DLL to being used by code written in the same language and
could even result in the DLL only being usable from code written in the same 
development environment.

The preferred solution is to have the DLL return a handle to the caller and to 
provide handle based functions to manipulate the class. Ideally the DLL 
provider would write a wrapper class for the client that encapsulates this
handle based API.

The handle can either by an index into a DLL-side array or a pointer to the 
class inside the DLL. The index approach lends itself more easily to handle 
validation but the pointer approach can be quicker.
--
Andrue Cope
[Bicester, UK]
Technical Details
Message-ID: <VA.00001f61.002f4dad@email.address.sorry>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!12.120.28.37.MISMATCH!attla2!ip.att.net!in.100proofnews.com!in.100proofnews.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f6803c9@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,22e82f8bbd730545
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-17 01:42:01 PST
Date: Wed, 17 Sep 2003 09:37:09 +0100
Newsgroups: borland.public.cppbuilder.nativeapi
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: Virtual Access by Atlantic Coast PLC, http://www.atlantic-coast.com/va
Message-ID: <VA.00001f61.002f4dad@email.address.sorry>
Subject: Re: Load DLL Class dynamic
From: Andrue Cope <not.a.valid@email.address.sorry>
Reply-To: not.a.valid@email.address.sorry
References: <3f6803c9@newsgroups.borland.com>
NNTP-Posting-Host: 217.207.223.34
X-Trace: newsgroups.borland.com 1063787921 217.207.223.34 (17 Sep 2003 01:38:41 -0700)
Lines: 23
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!12.120.28.37.MISMATCH!attla2!ip.att.net!in.100proofnews.com!in.100proofnews.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail