Hi guys,
I need to load a bitmap image from the file and show it in the screen in MFC. The following code load the image from a resource but I want to load it from a file.
void CScViewView::OnDraw(CDC* pDC)
{
CScViewDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;

CBitmap bmpCar;
CDC mdcCar;
CSize szeBitmap;
bmpCar.LoadBitmapW(IDB_BITMAP1);
szeBitmap.cx = 1276;
szeBitmap.cy = 1024;
mdcCar.CreateCompatibleDC(pDC);
CBitmap *bmpOld = mdcCar.SelectObject(&bmpCar);
pDC->BitBlt(0, 0, 1276, 1024, &mdcCar, 0, 0, SRCCOPY);
pDC->SelectObject(bmpOld);
SetScrollSizes(MM_TEXT, szeBitmap);
}

I replaced the LoadBitmapW with this bmpCar.LoadBitmap((LPCTSTR) "mybitmap.bmp"), but it does not work.
Thanks for you help in advance.
Hossein