Access Violation trying to InsertPicture

General TRichView support forum. Please post your questions here
Post Reply
baileyrc
Posts: 11
Joined: Fri Apr 27, 2007 11:44 pm

Access Violation trying to InsertPicture

Post by baileyrc »

Hey,

I'm a newbie with TRichView and BDS C++ 2006, but I get the following error printed inside my TRchiViewEdit control. "Error: Access violation at address 004ECA37 in module 'MyProject.exe'". What might be causing this error? I'm using TRichViewEdit version v1.9.24.

Code: Select all

Graphics::TBitmap *bmp;
try {
	bmp = new Graphics::TBitmap();
	bmp->LoadFromFile(fn);
	RichViewEdit1->InsertPicture("",(TGraphic*)bmp,rvvaBaseline);
} __finally {
	delete bmp;
}
shmp
Posts: 140
Joined: Sun Aug 28, 2005 10:19 am
Location: Sabah, Malaysia.
Contact:

Post by shmp »

Do not delete bmp. In case if you wish to delete it, use exception instead of finally.
baileyrc
Posts: 11
Joined: Fri Apr 27, 2007 11:44 pm

Post by baileyrc »

Thanks, worked like a charm
Post Reply