codeguard太强了,只是这个错误不知如何解决
Error 00001. 0x130C10 (Thread 0x0DB0):
Method called on illegally casted object: Attempt to access 216 byte(s) at
0x00F46E34. The 'this' pointer points to heap block 0x00F46E34 which is only
212 bytes long.
Call Tree:
0x00405C2A(=NewInterFacePjt.exe:0x01:004C2A) D:\BORLAND\CBUILDER5\INCLUDE\VCL\ADODB.hpp#261
0x00405B15(=NewInterFacePjt.exe:0x01:004B15) F:\NewInterfaceBeta2.5_走读\MainFace.cpp#173
0x40053323(=VCL50.BPL:0x01:052323)
0x4005301F(=VCL50.BPL:0x01:05201F)
0x4005ABFC(=VCL50.BPL:0x01:059BFC)
0x00401645(=NewInterFacePjt.exe:0x01:000645) F:\NewInterfaceBeta2.5_走读\NewInterFacePjt.cpp#56
The memory block (0x00F46E34) [size: 212 bytes] was allocated with SysGetMem
Call Tree:
0x40002C3A(=VCL50.BPL:0x01:001C3A)
0x4002A8B2(=VCL50.BPL:0x01:0298B2)
0x4002AAFE(=VCL50.BPL:0x01:029AFE)
0x4002AA3D(=VCL50.BPL:0x01:029A3D)
0x40030B3E(=VCL50.BPL:0x01:02FB3E)
0x40053566(=VCL50.BPL:0x01:052566)
------------------------------------------
F:\NewInterfaceBeta2.5_走读\MainFace.cpp#173代码如下
在FormCreate里面
ADOConnection1->ConnectionString = m_ConnectionString;
try
{
ADOConnection1->Open();
}
catch(...)
{
Application->MessageBox("数据库打开失败!","错误信息",MB_OK | MB_ICONINFORMATION);
Application->Terminate();
}
D:\BORLAND\CBUILDER5\INCLUDE\VCL\ADODB.hpp#261 代码如下:
inline void __fastcall Open() { inherited::Open(); }
F:\NewInterfaceBeta2.5_走读\NewInterFacePjt.cpp#56 代码如下:
Application->CreateForm(__classid(TFrmMainFace), &FrmMainFace);
这个提示错误的确有错误,我在用codeguard之前就发现,不知为何,如果数据库连接失败,按道理应该提示失败,程序结束
可是他还出来其他乱七八糟的错误,数据库连接成功,就没有什么问题。其实还是隐藏错误,codeguard给我找出来了,只是不知道如何着手解决,看代码看不出什么问题,忘大侠帮助
只剩下最后一个错误了,各位帮帮忙
程序特殊,第一次这么认真,一个错误也不放过