Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use GDI+ in my MFC Application.
When I debug it, the output window of VS2008 displays the below information:

First-chance exception at 0x4aee65a7 (GdiPlus.dll) in SkinMgr.exe: 0xC0000005: Access violation writing location 0x014a1044

Such messages fulfills the output window, but it runs well in Debug version as well as Release version.

I noticed that such warnings happen in Gdiplus::Bitmap::SelectActiveFrame and Gdiplus::Bitmap::GetHBitmap.

I don't know whether it's a potential error.
Did anyone has encountered such problem?
Appreciated for any help or tips.
Posted
Updated 9-Feb-11 17:36pm

GDI+ has been known to have quite a few bugs although many of those have been fixed (or even hotfixed) by now. That said, this may not be a GDI+ issue but an issue in a 3rd party component you are using (perhaps for skinning, based on the name of the exe). It's certainly not a good thing but it's also possible that these errors won't directly affect program behavior.

Worst case scenario is it's a problem in your code, in which case you should try and isolate out some minimal code that reproduces this problem. That may help you identify whether it's something you can fix or if it's something happening deep within GDI+ (in which case you may want to report it to Microsoft via Connect).
 
Share this answer
 
v2
Comments
mr.dot 10-Feb-11 0:30am    
Thanks, Nish.
I wrote one simplest demo which can demonstrate this problem:


int _tmain(int argc, _TCHAR* argv[])
{
ULONG_PTR dwToken = 0;
Gdiplus::GdiplusStartupInput _input;
Gdiplus::GdiplusStartup(&dwToken, &_input, NULL);

GUID pageGuid = Gdiplus::FrameDimensionTime;

HBITMAP hBitmap[10] = {0};
Bitmap* pBitmap = Bitmap::FromFile(_T("D:\\Projects\\SkinMgr\\Image\\checkingassist.gif"));

for(int i=0; i<10; ++ i)
{
pBitmap->SelectActiveFrame(&pageGuid, i);
pBitmap->GetHBITMAP(Color(0, 0, 0, 0), &hBitmap[i]);
DeleteObject(hBitmap[i]);
}

Gdiplus::GdiplusShutdown(dwToken);
return 0;
}


And I found that it's SelectActiveFrame.
Nish Nishant 10-Feb-11 17:36pm    
Ok, I believe this is a known bug in GDI+ when dealing with gif files. There is a Hotfix for it too.
Nish Nishant 10-Feb-11 17:39pm    
See http://support.microsoft.com/kb/971389 for more info.
mr.dot 10-Feb-11 21:16pm    
Thanks Nish.
I knew this article, and it's target OS is MS Vista or MS 2008 while I'm working on Windows XP.
And you know, we can't force users to install this hotfix for our software.

I'll post this problem to Connect, and wish MS could give one way out.

In fact, all programs I worked on has this problem, which of them are used by lots customers, and no one report anything about this.
Nish Nishant 10-Feb-11 22:06pm    
Yeah, I know. GDI+ is a lot of hassle (although it's also a big time saver). Try posting on Connect and give them your minimal repro project, that would be a good next step for you.
Not sure what's wrong with your code, but you may find this article helpful:
Adding GIF-animation using GDI+[^]

Regards
Espen Harlinn
 
Share this answer
 
Comments
mr.dot 11-Feb-11 1:45am    
Thanks Espen.
I have read that article, that doesn't work on this issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900