CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    2

    Getting Device Context in CWinApp::InitInstance?

    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


  2. #2
    Join Date
    Apr 1999
    Posts
    24

    Re: Getting Device Context in CWinApp::InitInstance?

    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



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured