I write a program, which must print data. My printer now is not working properly, but I should keep on working. So, to test my program I want to print to file, if it is possible.
Here is my code:
I thought that this line:Code:int res; DOCINFO docInfo; docInfo.lpszDocName="Some name"; docInfo.lpszOutput="print"; docInfo.cbSize=sizeof(DOCINFO); docInfo.fwType=0; docInfo.lpszDatatype="raw"; CDC *pDC; if(SendDlgItemMessage(IDC_PRINT_CHECK,BM_GETCHECK,0,0)!=BST_CHECKED) return; pDC=InitializePrinting(); res=::StartDoc(pDC->m_hDC,&docInfo); //pDC->StartDoc(_T("Some name")); ....
should name the file where I'm printing instead of the printer.Code:docInfo.lpszOutput="print";
But after that "printing" I didn't find such a file on my hard drive.
returns valid CDC object and the ::StartDoc() returns positive number- so it must works. Any suggests?Code:pDC=InitializePrinting();
And one more question: What is the format, in which the file is "printed" and how can I view it?