Original Post
I define hdc, hdc1 and bitmap in dialog class as follow:
HDC hdc;
HBITMAP bitmap;
bitmap = (HBITMAP)::LoadImageNULL, file, IMAGE_BITMAP, 640, 480, LR_LOADFROMFILE);
if(bitmap==NULL)
MessageBox("Can''t load bitmap!");
::SelectObject(hdc,bitmap); //set hdc bitmap
pOPla->GetDC( &hdc1 );
::BitBlt( hdc1 , 0 , 0 , 640 , 480 , hdc , 0 , 0 , SRCCOPY );
sprintf( num , " %d picture" , i ); //set message char
::TextOut(hdc1, 0, 0, num, lstrlen(num)); //draw message char
pOPla[i]->ReleaseDC( hdc1 ); //release DC
Why can not load bitmap, but char can load successfully! In addition, program running in CFrameWnd class very well!(it didn''t work in CDialog class). I doubt something have wrong with "::SelectObject(hdc,bitmap);" and "pOPla[i]->GetDC( &hdc1);" Is it can not use in this way at CDialog class.
D.M=3++