🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Multiple instances of data module

#6138
From: Rodney Haywood
Date: Wed, 08 Nov 2000 02:51
39 lines
2097 bytes
"Mark Cashman (TeamB)" wrote:

> You can create multiple instances of data modules private to a form or
> data module or class, but you must, then, not use the global variable
> provided by the data module.

Yes, I worked that out in the end.
 
> #include <finishdm.h>

Um, I was not including the header file for the data module into the
header file for the form, thats why I was getting a 

[C++ Error] finishform.h(32): E2303 Type name expected

I was assuming that because the forms cpp file included the data module
header it was there. But now that I look at the order the cpp file
includes its own header file before the header file for the data module.
 
> class MyForm: public TForm
> {
>     ...
>     TFinishDM *data;
> ...
> 
>     __fastcall  MyForm::MyForm(void)
>     {
>         data = new TfinishDM(Application);
>     }
> 
> Does this help?

Yes, I now don't have to cast it everywhere because of the header file
fixup.

What about the cleanup of "data"? Do I have to "delete" it somewhere or
will that happen when the form class is deleted?

Rodos
Technical Details
Message-ID: <3A08BFCD.61117830@haywood.org>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!news.tele.dk!194.176.220.129!newsfeed.icl.net!ldn-newsfeed.speedport.net!newsfeed.speedport.net!naxos.belnet.be!news.belnet.be!bornews.borland.com!dnews!203.26.8.19
References: <3A064F8D.731448BE@haywood.org> <3A07A530.F12A8807@haywood.org> <3A0871A0.45C665F4@temporaldoorway.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,a42aa6a7705c5eba
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2000-11-07 19:10:29 PST
Message-ID: <3A08BFCD.61117830@haywood.org>
Date: Wed, 08 Nov 2000 13:51:57 +1100
From: Rodney Haywood <rodos@haywood.org>
X-Mailer: Mozilla 4.74 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Multiple instances of data module
References: <3A064F8D.731448BE@haywood.org> <3A07A530.F12A8807@haywood.org> <3A0871A0.45C665F4@temporaldoorway.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 203.26.8.19
X-Trace: 7 Nov 2000 18:41:58 -0800, 203.26.8.19
Lines: 39
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!news.tele.dk!194.176.220.129!newsfeed.icl.net!ldn-newsfeed.speedport.net!newsfeed.speedport.net!naxos.belnet.be!news.belnet.be!bornews.borland.com!dnews!203.26.8.19