HDC LoadBitmapToHDC(LPCTSTR bitmap_name, HBITMAP& hBitmap )
hBitmap = ::LoadBitmap(::AfxGetInstanceHandle(), bitmap_name);
HDC MemDC = ::CreateCompatibleDC(NULL);
I have been able to use the above in an application.
However, I am now trying to move the function into a DLL.
I am getting an error message:
error C2039: AfxGetInstanceHandle: is not a member of global namespace
How do I correct this error?
Thanks in Advance.
Thank you for your response.
I have been able to compile the application after adding the header file.
I am getting a runtime error now.
I am not trying to export this function. I am trying to reduce all instances of applications from loading the same bitmaps into memory.
Maybe what I am doing is wrong. I might have no choice but to load all my running instances with the same bitmaps.
I would just like to load the bitmaps in a dll, and use the dll for returning values.
Example: If I am loading a bitmap of a cat, lion and table, in all 3 instances of my application. I am going to be loading them 3 times 3 bitmaps.
I want this to became load all 3 in a dll once and use the rest of the logic to return me values which are integer.
I hope I have explained a bit clearer as to what I intend to do?
[Modified: do not add more to your original question by posting an "answer" that isn't an answer. Modify the original post to include the new information or ask a new question.]