🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
6 messages
6 total messages Started by Lance Zhang Wed, 04 Apr 2001 03:26
ADO in DLL?
#5603
Author: Lance Zhang
Date: Wed, 04 Apr 2001 03:26
19 lines
1400 bytes
Hi! All,


Context:
I build a sample DLL following a article named "Using A Data Module In A
DLL" By Mr. Mark CashMan published on http://www.temporaldoorway.com about
how to put a datamodule in a dll--specifically the way to initialize a
datamodule in a DLL.

When I use a combination of TDatabase and TQuery it works just fine.
But when I substitute them with TADOConnection and TADOQuery, an
EOleSysError stating "CoInitiliaze not yet called" is raised upon the
constructor of TDataModule1.

Is it a ADO bug or just I neglect some steps?

Pleas help!

Lance Zhang
Re: ADO in DLL?
#5605
Author: Giuliano
Date: Wed, 04 Apr 2001 11:57
17 lines
1288 bytes
On Wed, 4 Apr 2001 11:26:27 +0800, "Lance Zhang" <lance219@yeah.net> wrote:

[snip]
>When I use a combination of TDatabase and TQuery it works just fine.
>But when I substitute them with TADOConnection and TADOQuery, an
>EOleSysError stating "CoInitiliaze not yet called" is raised upon the
>constructor of TDataModule1.
[snip]

Hi Lance,

    I've used ADO in a ISAPI DLL some time ago, and I've had to call
CoInitialize. It had worked, for me.

Ciao!

Giuliano
Re: ADO in DLL?
#5615
Author: Patrick Martin
Date: Thu, 05 Apr 2001 00:41
54 lines
2339 bytes
This is a multi-part message in MIME format.
--------------BD09AD5002DC21116D97DFFE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Don't forget Conuninitialize too!

Giuliano wrote:

> On Wed, 4 Apr 2001 11:26:27 +0800, "Lance Zhang" <lance219@yeah.net> wrote:
>
> [snip]
> >When I use a combination of TDatabase and TQuery it works just fine.
> >But when I substitute them with TADOConnection and TADOQuery, an
> >EOleSysError stating "CoInitiliaze not yet called" is raised upon the
> >constructor of TDataModule1.
> [snip]
>
> Hi Lance,
>
>     I've used ADO in a ISAPI DLL some time ago, and I've had to call
> CoInitialize. It had worked, for me.
>
> Ciao!
>
> Giuliano

--------------BD09AD5002DC21116D97DFFE
Content-Type: text/x-vcard; charset=us-ascii;
 name="patrickmmartin.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Patrick Martin
Content-Disposition: attachment;
 filename="patrickmmartin.vcf"

begin:vcard 
n:Martin;Patrick
tel;pager:na
tel;cell:07773013982
tel;fax:na
tel;home:01483 303496
tel;work:na
x-mozilla-html:TRUE
url:http://www.freenetpages.co.uk/hp/patrickmmartin/
adr:;;72 Stoke Fields;Guildord;Surrey;;UK
version:2.1
email;internet:patrickmmartin@freenet.co.uk
title:Dr.
note:This is Patrick's home vcard
x-mozilla-cpt:;20176
fn:Patrick Michael Martin
end:vcard

--------------BD09AD5002DC21116D97DFFE--
Re: ADO in DLL?
#5517
Author: Lance Zhang
Date: Thu, 05 Apr 2001 02:27
33 lines
1679 bytes
Giuliano and Patrick,

Thank you both!

I'll have a try.

Lance

"Patrick Martin" <patrickmmartin@freenet.co.uk> wrote in message
news:3ACBBF4A.4FCA0CFB@freenet.co.uk...
> Don't forget Conuninitialize too!
>
> Giuliano wrote:
>
> > On Wed, 4 Apr 2001 11:26:27 +0800, "Lance Zhang" <lance219@yeah.net>
wrote:
> >
> > [snip]
> > >When I use a combination of TDatabase and TQuery it works just fine.
> > >But when I substitute them with TADOConnection and TADOQuery, an
> > >EOleSysError stating "CoInitiliaze not yet called" is raised upon the
> > >constructor of TDataModule1.
> > [snip]
> >
> > Hi Lance,
> >
> >     I've used ADO in a ISAPI DLL some time ago, and I've had to call
> > CoInitialize. It had worked, for me.
> >
> > Ciao!
> >
> > Giuliano
>
Re: ADO in DLL?
#5528
Author: Lance Zhang
Date: Fri, 06 Apr 2001 00:51
33 lines
1782 bytes
Patrick,

What's the right place to call CoUninitialize()?

Can you give a brief sample?

Lance Zhang

"Patrick Martin" <patrickmmartin@freenet.co.uk> wrote in message
news:3ACBBF4A.4FCA0CFB@freenet.co.uk...
> Don't forget Conuninitialize too!
>
> Giuliano wrote:
>
> > On Wed, 4 Apr 2001 11:26:27 +0800, "Lance Zhang" <lance219@yeah.net>
wrote:
> >
> > [snip]
> > >When I use a combination of TDatabase and TQuery it works just fine.
> > >But when I substitute them with TADOConnection and TADOQuery, an
> > >EOleSysError stating "CoInitiliaze not yet called" is raised upon the
> > >constructor of TDataModule1.
> > [snip]
> >
> > Hi Lance,
> >
> >     I've used ADO in a ISAPI DLL some time ago, and I've had to call
> > CoInitialize. It had worked, for me.
> >
> > Ciao!
> >
> > Giuliano
>
Re: ADO in DLL?
#5543
Author: Alan Lichtenstein
Date: Mon, 09 Apr 2001 16:04
36 lines
1988 bytes
I like to force the calling of CoInitialize & CoUninitialize by calling them
in the constructor & destructor methods respectively of a global variable...
Declare this variable when you first start the app.... The constructor is
called automatically when the app starts & the destructor is called when the
app goes out of scope or ends.....

For instance I borrowed this from a VC++ sample provided by Microsoft....

struct InitOle {
  InitOle()  { ::CoInitialize(NULL); }
  ~InitOle() { ::CoUninitialize();   }
} _init_InitOle_;


Lance Zhang wrote in message <3aca95fa_2@dnews>...
>Hi! All,
>
>
>Context:
>I build a sample DLL following a article named "Using A Data Module In A
>DLL" By Mr. Mark CashMan published on http://www.temporaldoorway.com about
>how to put a datamodule in a dll--specifically the way to initialize a
>datamodule in a DLL.
>
>When I use a combination of TDatabase and TQuery it works just fine.
>But when I substitute them with TADOConnection and TADOQuery, an
>EOleSysError stating "CoInitiliaze not yet called" is raised upon the
>constructor of TDataModule1.
>
>Is it a ADO bug or just I neglect some steps?
>
>Pleas help!
>
>Lance Zhang
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads