mfc引入位图时有错误,菜鸟跪求指点
class CGoBangView : public CView
{
protected: // create from serialization only
CGoBangView();
DECLARE_DYNCREATE(CGoBangView)
// Attributes
public:
CGoBangDoc* GetDocument();
// Operations
public:
CBitmap bitmap;
CDC BEGIN;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGoBangView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CGoBangView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CGoBangView)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
void CGoBangView::OnDraw(CDC* pDC)
{
CGoBangDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
static int i=0;
if(i==0)
{
bitmap=(HBITMAP)LoadImage(NULL,"IDB_BACKGROUND.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
BEGIN.CreateCompatibleDC(pDC);
BEGIN.SelectObject(bitmap);
i=1;
}
pDC->BitBlt(0,0,119,64,&BEGIN,0,0,SRCCOPY);
}自动生成的mfc框架,只在上面部分做了修改想引入位图作为框体背景,但是提示错误error C2582: 'CBitmap' : 'operator =' function is unavailable,就是OnDraw函数里那句bitmap=(HBITMAP)LoadImage(NULL,"IDB_BACKGROUND.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);报错的,跪求大神指导啊