BOOL CAboutDlg::OnInitDialog()
      {
          CDialog::OnInitDialog();          // Create and Initialize the CPictureHolder variable with the
          // toolbar resource
          CPictureHolder pictholder;
          pictholder.CreateFromBitmap(IDR_MAINFRAME);          //Pass dispatch pointer to CPictureHolder
          m_grid.SetPicture(pictholder.GetPictureDispatch());          // NOTE: GetPictureDispatch() QI()'s for the IPictureDisp
          // interface, so the picture object will remain alive until
          // the property is reset or the control is destroyed. When
          // pictholder goes out of scope, it calls Release() on the
          // picture object, but the previously mentioned QI() will have
          // bumped the ref count, allowing it to remain alive until the
          // control itself releases the picture object.        return TRUE;
      }

解决方案 »

  1.   

    楼上贴的是什么意思?
    CPicture pic=m_grid.GetPicture();
    pic.GetHandle()返回的是什么?
      

  2.   

    返回的是图像句柄
    你要Handle干什么?Render就好啦
      

  3.   

    图像句柄与HBITMAP有没有关系?
    有了图象句柄又如何将图像显示出来?
      

  4.   

    显示用IPicture::Render就可以
    图象类型是BMP时,GetHandle返回HBITMAP