BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: ADO and DLL

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE)
View previous topic :: View next topic  
Author Message
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Sep 19, 2005 5:20 pm    Post subject: Re: ADO and DLL Reply with quote




"Borut Šuštar" <borut (AT) bokosoft (DOT) si> wrote


Quote:
Nast->ConnectionString = nastavitve("TrgoLocal"); --> here is an error
"Access violation at adress 40653F in module 'adortl60.bpl'.Read of
address
55433."

You did not instantiate an actual instance of the TADODataSet class. The
error is caused by you accessing invalid memory.

Also, you should not be calling CoUninitialize() until after you are
completely finished using ADO. The COM library must remain initialized for
the calling thread while you are working with the ADO system.


Gambit



Back to top
Liz Albin
Guest





PostPosted: Mon Sep 19, 2005 5:28 pm    Post subject: Re: ADO and DLL Reply with quote



On Mon, 19 Sep 2005 16:52:24 +0200, Borut ?u?tar wrote:

Quote:
Nast->ConnectionString = nastavitve("TrgoLocal"); --> here is an error

that's because Nast is only a pointer.

use new to initialize it, or a smart pointer (e.g. auto_ptr)
--
Good luck,

liz

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Sep 19, 2005 8:38 pm    Post subject: Re: ADO and DLL Reply with quote




"Liz Albin" <lizalbinNotThis (AT) yahoo (DOT) com> wrote


Quote:
use new to initialize it, or a smart pointer (e.g. auto_ptr)

Even if you use auto_ptr, you still need to use 'new'.


Gambit



Back to top
Liz Albin
Guest





PostPosted: Tue Sep 20, 2005 3:13 am    Post subject: Re: ADO and DLL Reply with quote

On Mon, 19 Sep 2005 13:38:36 -0700, Remy Lebeau (TeamB) wrote:

Quote:
Even if you use auto_ptr, you still need to use 'new'.

Within the assignment, yes
--
Good luck,

liz

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Sep 20, 2005 4:16 pm    Post subject: Re: ADO and DLL Reply with quote


"Borut Šuštar" <borut (AT) bokosoft (DOT) si> wrote


Quote:
I tried like this:
TADODataSet *Nast = new TADODataSet;
but when i compile i get error (Could not find a match for
'TADODataSet::TADODataSet()')

As well you should be. If you look in the documentation, you will see that
TADODataSet's constructor takes an Owner parameter, just like every other
component does, ie:

TADODataSet *Nast = new TADODataSet(SomeComponent);

Or:

TADODataSet *Nast = new TADODataSet(NULL);
//...
delete Nast;


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.