Hi all,
I have an exception like this:
Here are my code
CPictureControl m_textImage;
m_textImage.Load(data.data1->GetData(),
data.data1->GetSize());
Bitmap img(m_textImage.m_pStream, TRUE);
Bitmap* pThumbnail = static_cast<Bitmap*>(img.GetThumbnailImage(85, 95, NULL, NULL));
pThumbnail->GetHBITMAP(NULL, &hBmp);
pImage = new CBitmap();
pImage->Attach(hBmp);
cImage->Add(pImage,pImage);
delete pThumbnail;
delete pImage;
In my code cImage is CImageList
But when I run, some time error happens at: gdiplusbitmap.h
inline
Image::~Image()
{
DllExports::GdipDisposeImage(nativeImage);
}
Error Message is: An unhandled exception of type 'System.AccessViolationException' occurred in Test.exe
Additional information:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt
It happens randomly and not very often. I don't know how to handle it.
Please help me.
Thanks,
-------------------------------------------------
[Update]
I already tried to delete pImage before pThumnail but nothing happen