🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
2 messages
2 total messages Started by Ars Nova Mon, 20 Mar 2006 09:43
TADODataSet
#450
Author: Ars Nova
Date: Mon, 20 Mar 2006 09:43
16 lines
1275 bytes
I want to create a TADODataSet object through new operator, and I've probed with:

     TADODataSet * objDataSet;
     
     objDataSet = new TADODataSet(NULL); 
     or
     objDataSet = new TADODataSet(this); 
     where 'this' is a    TADOConnection object reference.

In both cases this generates the follow Codeguard: 
"Method called on illegally casted object: Attempt to access 608 byte(s) at 0x01214658. The 'this' pointer points to heap block 0x01214658 which is only 604 bytes long."

How can I do it?

Thank you very much�
Re: TADODataSet
#451
Author: Rudy Veeneman
Date: Fri, 24 Mar 2006 08:02
58 lines
2467 bytes
We had the same problem with TADODataSet in CBuilder. We found a workaround 
by using a "wrapper class".

class TMyDataSet : public TADODataSet
{
private:

protected:

public:
  __fastcall virtual TMyDataSet (Classes::TComponent* AOwner);
  __fastcall virtual ~TMyDataSet (void);
};

__fastcall TMobaDataSet::TMobaDataSet(Classes::TComponent* AOwner)
  : TADODataSet(AOwner)
{
}

__fastcall TMobaDataSet::~TMobaDataSet(void)
{
}

Create a TMyDataSet object though new operator:
  TMyDataSet* objDataSet = new TMyDateSet(NULL);

Other way to solve the problem is to use TADOQuery in stead of TADODataSet.
In CBuilder 'new TADOQuery(NULL)' does not give problems with codeguard

Rudy







"Ars Nova" <lmuniz@ars-nova.net> schreef in bericht 
news:441e876e$1@newsgroups.borland.com...
>
> I want to create a TADODataSet object through new operator, and I've 
> probed with:
>
>     TADODataSet * objDataSet;
>
>     objDataSet = new TADODataSet(NULL);
>     or
>     objDataSet = new TADODataSet(this);
>     where 'this' is a    TADOConnection object reference.
>
> In both cases this generates the follow Codeguard:
> "Method called on illegally casted object: Attempt to access 608 byte(s) 
> at 0x01214658. The 'this' pointer points to heap block 0x01214658 which is 
> only 604 bytes long."
>
> How can I do it?
>
> Thank you very much� 
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