Hello everybody! Yesterday I had posted about a problem I was having creating Gdiplus::Image's. I have a related issue now, where the call to Gdiplus::Image::Image(const WCHAR *filename, BOOL useEmbeddedColorManagement)
crashes the program.
Here is the code that calls this function: m_pImage = new Gdiplus::Image(a_ImagePath);, where m_pImage is a pointer to a Gdiplus::Image and a_ImagePath is a constwchar_t* to a valid path.
When the program is compiled and run, the actual window does not show up, and half of the time I get a popup box saying the program has stopped working, etc. Under more details it points to an XML file which supposedly has more details on the error, which I pasted here: http://pastebin.com/hGXM6g06 .
I have used my IDE's debugger (Code::Blocks), and it segfaults at the constructor call for the Gdiplus::Image constructor. Thank you for your help, let me know if I can provide any more information.
Make sure a_ImagePath is a valid pointer - Windows API Calls many times don't check the validity of the pointers.
If there's a problem, either you're out of ram, you previously did bad allocations with another block of memory, or a_ImagePath is a bad pointer.
// In your entrypoint:
Gdiplus::Image * pImage = new Gdiplus::Image(L"imagepath here");
And see if it bugs. If it does, it's a GDI+/Library problem. If it doesn't, you must have got problems with your class's memory allocation, which is really weird as you initialize other variables before the image, and you don't notice any other crash.