MFC GetBitmap Problem

I opened a Single Document with VC++ 5 and Windows XP.
The compiler gave no errors.

The image loads, but I get an assertion when I get to the line

bmp.GetBitmap(&bi);

The assertion mentions afxwin1.inl, Line 413.

What have I forgotten?

// CMyAppView message handlers

void CMyAppView::OnDip08H()
{
// TODO: Add your command handler code here
CString szFilename("toolbar.bmp");
HBITMAP hBmp = (HBITMAP)::LoadImage(NULL,szFilename,
IMAGE_BITMAP,0,0,
LR_LOADFROMFILE|LR_CREATEDIBSECTION);

CBitmap bmp;
bmp.Attach(hBmp);

CClientDC dc(this);
CDC bmDC;
bmDC.CreateCompatibleDC(&dc);
CBitmap *pOldbmp = bmDC.SelectObject(&bmp);

BITMAP bi;
bmp.GetBitmap(&bi);

dc.BitBlt(0,0,bi.bmWidth,bi.bmHeight,&bmDC,0,0,SRCCOPY);

bmDC.SelectObject(pOldbmp);

}
[995 byte] By [drikgrit] at [2007-11-20 8:14:34]