I have a problem printing a bmp picture. I tried to use the below function code but it did n't help. If someone could take the time to outline exactly how I can print a bmp picture I would be truly greatful. Keeping in mind I'm new to the CDC.

Thanks for any help you can offer


void CBarGenDlg::OnPrint()
{
CDC dc;
CDC* pDC;
HDC hdc;
CString szPrinterName;
LPDEVMODE pdm;
CPrintDialog pd(FALSE,
PD_ALLPAGES | PD_NOPAGENUMS | PD_RETURNDC |
PD_DISABLEPRINTTOFILE | PD_HIDEPRINTTOFILE |
PD_NONETWORKBUTTON | PD_NOSELECTION , pPWnd);
int iRet = pd.GetDefaults();
hdc = pd.GetPrinterDC();
pDC = dc.FromHandle(hdc);
iRet = pPWnd->PostMessage(WM_PRINT,(WPARAM)
hdc,PRF_CLIENT);
}