环境:VS2008 SP1专业版
我有一个使用CImage :: StretchBlt()方法的函数。代码在32位环境中正确编译,但在64位中,它总是显示错误
c:\ program files(x86)\ microsoft visual studio 9.0 \ vc \ atlmfc \ include \ atlimage.h(398):致命错误C1001:编译器中发生内部错误。
void CMyListView::DrawHistoryThumbnail( int nIndex )
{
CRect rctThumbnail;
GetThumbnailRect( rctThumbnail );
CImage imgHistory;
imgHistory.LoadFromResource( AfxGetResourceHandle(), IDB_BITMAP_HISTORY_THUMBNAIL );
CDC* pDC = GetDC();
CDC dcMemory;
dcMemory.CreateCompatibleDC( pDC );
CBitmap bmpHistory;
bmpHistory.CreateCompatibleBitmap( pDC, rctThumbnail.Width(), rctThumbnail.Height() );
CBitmap* pOldBmp = dcMemory.SelectObject( &bmpHistory );
// if comment the below issue goes away
imgHistory.StretchBlt( dcMemory.GetSafeHdc(), rctThumbnail, SRCCOPY );
CBrush brushFrame;
brushFrame.CreateSolidBrush( RGB(0, 0, 255) );
dcMemory.FrameRect( rctThumbnail, &brushFrame );
dcMemory.SelectObject( pOldBmp );
ReleaseDC( pDC );
}