I have set the MS Visual Studio to include winspool.lib and the project links to the correct include and library directories.
I have tried with an #include <winspool.h> and without.
Our environment is XP Client and Win 2003 Server.
What have I missed?
Code:ENZ_WinFax.h #include "stdafx.h" #include "winfax.h" #include <windows.h> //#include <winspool.h> ENZ_WinFax.cpp #include "stdafx.h" #include "ENZ_WinFax.h" #include <string.h> #include <stdio.h> ..... HWND hWnd = GetForegroundWindow(); int faxRetVal; int endRetVal; int delRetVal; int startPageRetVal; FAX_PRINT_INFO fpi; fpi.SizeOfStruct=sizeof(FAX_PRINT_INFO); fpi.RecipientNumber = "[FaxNumber]"; fpi.DocName = "[??????]"; fpi.RecipientName = "Test Fax "; fpi.SenderName = "[??????]"; fpi.SenderCompany = "[??????]"; fpi.SenderDept = "[??????]"; fpi.SenderBillingCode = "None"; fpi.DrEmailAddress = NULL; fpi.Reserved = NULL; fpi.OutputFileName = NULL; DWORD nJobID; FAX_CONTEXT_INFO fci; fci.SizeOfStruct=sizeof(FAX_CONTEXT_INFO); faxRetVal = FaxStartPrintJob("\\\\[servername]\\Desktop Fax",&fpi,&nJobID,&fci); startPageRetVal = StartPage(fci.hDC); //Print the document as normal - small but interesting process. //return nJobID; if (IsWindow(hWnd)) { if ( PrintWindow(hWnd,fci.hDC,PW_CLIENTONLY) ) return nJobID; else return 0; } else { return 0; } endRetVal = EndDoc(fci.hDC); delRetVal = DeleteDC(fci.hDC);
When I try to compile this the following error is generated
C:\Program Files\Microsoft Visual Studio\MyProjects\Faxing\ENZ_WinFax\ENZ_WinFax.cpp(66) : error C2065: 'PrintWindow' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\Faxing\ENZ_WinFax\ENZ_WinFax.cpp(66) : error C2065: 'PW_CLIENTONLY' : undeclared identifier
Error executing cl.exe.




Reply With Quote