print in MFC dialog

I want to how to print statement in the MFC.

void Specific_enthalpy_Dew_point::OnBnClickedPrintsedp()
{
// TODO: Add your control notification handler code here

CPrintDialog MyPrintDlg(FALSE);
DOCINFO docInfo;
ZeroMemory(&docInfo, sizeof(docInfo));
docInfo.cbSize = sizeof (docInfo);
docInfo.lpszDocName = L"GdiplusPrint";
UpdateData(TRUE);
CPoint PrintOffset(50,50);


if ( MyPrintDlg.DoModal () == IDOK)
{
//Write code for printing
//Get a handle to the printer device context (DC).
HDC hdc = MyPrintDlg.GetPrinterDC ();
ASSERT (hdc);

StartDoc(hdc, &docInfo);
StartPage(hdc);

this->UpdateData(TRUE);

printf_s("When ");

printf_s(" and ");


EndPage(hdc);
EndDoc(hdc);

//Clean up.
CDC::FromHandle(hdc)->DeleteDC();
}

}

I want to know print thing to the printer, use print ???, I use printf_s but nothing print out.

for print to file use fwprintf_s(myfile,L"When ");
print to printer use what friction
Topic archived. No new replies allowed.