🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #581

Share DataModule between Exe and Dll

#581
From: C�dric LE FRINGERE
Date: Thu, 12 Jan 2006 11:46
37 lines
1840 bytes
Hi,

I'm trying to share a DataModule with ADO components between an Exe and a
Dll.

So after, I call from the Exe LoadLibrary and GetProcAdresse, I invoke the
export procedure passing in parameter a pointer of my DataModule.
In the Dll, oftenly I can use TADOComponent one time (close and open on
TADOQuery), the second time I've got an access violation.

typedef void (WINAPI *PPROCEDURE) (TDataModule *);
module = LoadLibrary("myDll.dll");
if (module != 0)
{
    procedure = (PPROCEDURE) GetProcAddress(module, "exportprocedure");
    if (procedure != NULL)
   {
        procedure(MyDataModule);
   }
}

Any idea what to do?

Thanks

-- 
C�dric LE FRINGERE
Ing�nieur

BA SYSTEMES
Route de Chavagne - BP 36
35310 MORDELLES
FRANCE

Tel : +33 (0)2 99 85 11 00
Fax : +33 (0)2 99 85 11 44
E-Mail : cedric.lefringere@basystemes.fr 
Technical Details
Message-ID: <43c64118@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,ea02df0441c050ba,start
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "C�dric LE FRINGERE" <cedric.lefringere@basystemes.fr>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Share DataModule between Exe and Dll
Date: Thu, 12 Jan 2006 12:46:57 +0100
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 217.167.0.1
Message-ID: <43c64118@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1137066264 217.167.0.1 (12 Jan 2006 03:44:24 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail