void CMy828View::OnDraw(CDC* pDC)
{
CMy828Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// CClientDC dc(this);
// dc.TextOut(20,20,"你就是我的唯一");
 //    flag=FALSE;AfxOleInit(); 
IPicture *pPic; 
IStream *pStm; CFileStatus fstatus; 
CFile file; 
LONG cb; if(file.Open("c:\\test.jpg",CFile::modeRead)&&file.GetStatus("c:\\test.jpg",fstatus)&&(cb = fstatus.m_size)!= -1)

HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, cb); 
LPVOID pvData = NULL; 
if (hGlobal != NULL) 

if ((pvData = GlobalLock(hGlobal)) != NULL) 

file.ReadHuge(pvData, cb); 
GlobalUnlock(hGlobal); 
CreateStreamOnHGlobal(hGlobal, TRUE, &pStm); if(SUCCEEDED(OleLoadPicture(pStm,fstatus.m_size,TRUE,IID_IPicture,(LPVOID*)&pPic))) 

OLE_XSIZE_HIMETRIC hmWidth; 
OLE_YSIZE_HIMETRIC hmHeight; pPic->get_Width(&hmWidth); 
pPic->get_Height(&hmHeight); double fX,fY; 
fX = (double)pDC->GetDeviceCaps(HORZRES)*(double)hmWidth/((double)pDC->GetDeviceCaps(HORZSIZE)*100.0); 
fY = (double)pDC->GetDeviceCaps(VERTRES)*(double)hmHeight/((double)pDC->GetDeviceCaps(VERTSIZE)*100.0); 
if(FAILED(pPic->Render(*pDC,0,0,(DWORD)fX,(DWORD)fY,0,hmHeight,hmWidth,-hmHeight,NULL))) 
AfxMessageBox("Failed To Render The picture!"); 
pPic->Release(); 

else 
AfxMessageBox("Error Loading Picture From Stream!"); 



else 
AfxMessageBox("Can't Open Image File!"); 
}
以上代码,在OnDraw函数中编译没有错误,但是却无法实现,test,jpg存在
路径没有错误。请高手帮忙