|
增加如下代码,把错误信息输出到log,看看错误到底是什么,- if (!OpenPrinter(printerName, &printer, NULL) )
- {
- WriteToLog("Error OpenPrinter.");
- //printf("OpenPrinter GetLastError %d \n",GetLastError());
- sprintf(strerr,"OpenPrinter GetLastError %d \n",GetLastError());
- WriteToLog(strerr);
-
- }
-
- if( !StartDocPrinter(printer, 1, (LPBYTE)&info))
- {
- WriteToLog("Error StartDocPrinter.");
- //printf("StartDocPrinter GetLastError %d ",GetLastError());
- sprintf(strerr,"StartDocPrinter GetLastError %d \n",GetLastError());
- WriteToLog(strerr);
- }
复制代码
|
|