How do I create a Device Context before any windows in my application have been created? I need to create a bitmap for use later in the creation process.
Thanks
Printable View
How do I create a Device Context before any windows in my application have been created? I need to create a bitmap for use later in the creation process.
Thanks
You maybe know the Device context is linked to the any window or more exact HWND type.
In CWinApp::InitInstance you are not created a window yet.
But you want to create a bitmap only and the DC is not needed.
To do it you should create an object HBITMAP and you can use
HBITMAP CreateBitmapIndirect( CONST BITMAP *lpbm /* pointer to the bitmap data */ );
See the help for details