 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Sep 19, 2005 5:20 pm Post subject: Re: ADO and DLL |
|
|
"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
|
Posted: Mon Sep 19, 2005 5:28 pm Post subject: Re: ADO and DLL |
|
|
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
|
Posted: Mon Sep 19, 2005 8:38 pm Post subject: Re: ADO and DLL |
|
|
"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
|
Posted: Tue Sep 20, 2005 3:13 am Post subject: Re: ADO and DLL |
|
|
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
|
Posted: Tue Sep 20, 2005 4:16 pm Post subject: Re: ADO and DLL |
|
|
"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 |
|
 |
|
|
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
|
|