Article View: borland.public.cppbuilder.database.ado
Article #5565Codeguard and ADO objects
From: Jurko
Date: Wed, 18 Apr 2001 08:09
Date: Wed, 18 Apr 2001 08:09
60 lines
3068 bytes
3068 bytes
Hello.
When using ADO objects in C++ Builder and the application
has codeguard options enabled I often get the following codeguard
exception:
When using TADOConnection:
------------------------------------------
Error 00050. 0x130C10 (Thread 0x013B):
Method called on illegally casted object: Attempt to access
216 byte(s) at 0x01351F50. The 'this' pointer points to heap
block 0x01351F50 which is only 212 bytes long.
Call Tree:
(...stack listing comes here...)
The memory block (0x01351F50) [size: 212 bytes] was
allocated with SysGetMem
Call Tree:
(...stack listing comes here...)
------------------------------------------
When using TADODataSet:
------------------------------------------
Error 00088. 0x130C10 (Thread 0x013B):
Method called on illegally casted object: Attempt to access
584 byte(s) at 0x01360CF0. The 'this' pointer points to heap
block 0x01360CF0 which is only 580 bytes long.
Call Tree:
(...stack listing comes here...)
The memory block (0x01360CF0) [size: 580 bytes] was
allocated with SysGetMem
Call Tree:
(...stack listing comes here...)
------------------------------------------
I've traced through the code and sizeof(TADoConnection) is 216, and not
212, so I would guess 216 bytes get allocated. But then how come
Codeguard gets messed up?
I've seen an answer to this question before, but it was a quick fix stating
that Codeguard doesn't get teh right information if you don't set you
applications data alignment to BYTE. (QUADWORD is default). I still
haven't found any confirmation of this... Is this just a Codeguard quirk?
If it is, is there a nice way to go around it (the previous solution i not
NICE :-).
And if it isn't, hmmm then is there a bug floating around my app that I
don't know about?
The supposed casting always missedby 4 bytes, so I don't really see how
data alignment should have anything to do with it, but thats just hunch...
have nothing to back up that claim.
Btw. the bug happens every time open those objects. Does not appen
when using TADOCommand for example.
If you have any ideas or suggestions orsimply know know the answer
please post it here or mail it directly to me.
Thank you.
Jurko
Technical Details
Message-ID:
<3add4b86_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!sn-xit-03!supernews.com!news-out.visi.com!hermes.visi.com!news.maxwell.syr.edu!hammer.uoregon.edu!feed.textport.net!news.bnb-lp.com!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,61640d8fc7651ac1,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-04-18 01:28:04 PST From: "Jurko" <Jurko@ve-mil.hr> Newsgroups: borland.public.cppbuilder.database.ado Subject: Codeguard and ADO objects Date: Wed, 18 Apr 2001 10:09:44 +0200 Lines: 62 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 195.29.221.130 Message-ID: <3add4b86_1@dnews> X-Trace: dnews 987581318 195.29.221.130 (18 Apr 2001 01:08:38 -0700) Path: arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!sn-xit-03!supernews.com!news-out.visi.com!hermes.visi.com!news.maxwell.syr.edu!hammer.uoregon.edu!feed.textport.net!news.bnb-lp.com!dnews