谢谢

解决方案 »

  1.   

    CBitmap bmp;
    HBITMAP hBmp;
    hBmp = (HBITMAP)bmp;
      

  2.   

    BITMAP hbitmap;
    bitmap.GetBitmap(&hbitmap);
      

  3.   

    CBitmap已经重载了HBITMAP操作,可以直接用CBitmap::operator HBITMAP
    operator HBITMAP( ) const;Return ValueIf successful, a handle to the Windows GDI object represented by the CBitmap object; otherwise NULL.ResUse this operator to get the attached Windows GDI handle of the CBitmap object. This operator is a casting operator, which supports direct use of an HBITMAP object.For more information about using graphic objects, see Graphic Objects in the Win32 Programmer's Reference.
      

  4.   

    CBitmap bmp;
    HBITMAP hBmp;
    hBmp = (HBITMAP)bmp;
    就可以了,如果你愿意用
    BITMAP hbitmap;
    bitmap.GetBitmap(&hbitmap);
    也没有错。