🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
1 messages
1 total messages Started by Jurko Wed, 18 Apr 2001 08:09
Codeguard and ADO objects
#5565
Author: Jurko
Date: Wed, 18 Apr 2001 08:09
60 lines
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
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