Access violation C++builder

来源:百度知道 编辑:UC知道 时间:2024/06/09 04:23:55
void __fastcall TNewAcc::Image2MouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift,
int X, int Y)
{
HRGN threadrgn,tmprgn;
int x,y,t,h;
threadrgn = CreateRectRgn(0,0,Image1->Width,Image1->Height);
}

对话框里面调用出现 Access violation at address 00449190 in module "XXX.exe";

寻求解决方案. 引用Image1->Width就出错.

Access Violation就是指针指向了不能被访问的地址,这里应该是Image1->Width核Image1->Height的问题,你的Image1在这个函数里是不可见的,具体怎么改要看你的其他程序