Page 1 of 1

Access Violation trying to InsertPicture

Posted: Fri Apr 27, 2007 11:57 pm
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;
}

Posted: Sat Apr 28, 2007 12:27 am
by shmp
Do not delete bmp. In case if you wish to delete it, use exception instead of finally.

Posted: Sat Apr 28, 2007 2:03 am
by baileyrc
Thanks, worked like a charm