m_bInited(false), m_hMap(NULL), m_gdiplusToken(NULL),
_stprintf(buffer, _T("GDIPlusInitID=%x"), GetCurrentProcessId());
m_hMap = CreateFileMapping((HANDLE) INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE | SEC_COMMIT, 0, sizeof(long), buffer);
if (m_hMap != NULL)
// We might have a winner
if (GetLastError() == ERROR_ALREADY_EXISTS)
// Yes, we have a winner
m_bInited = true;
Gdiplus::GdiplusStartup(&m_gdiplusToken, &m_gdiplusStartupInput, NULL);
using namespace Gdiplus;
if (m_bInited && m_initcount == 0)
m_bInited = false;
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Software Developer (Senior)
Hans Dietrich Software
I attended St. Michael's College of the University of Toronto, with the intention of becoming a priest. A friend in the University's Computer Science Department got me interested in programming, and I have been hooked ever since.
Recently, I have moved to Los Angeles where I am doing consulting and development work.
For consulting and custom software development, please see www.hdsoft.org