winapi - GetDefaultPrinter() reference unfound in VC6 -


I getDefaultPrinter () and then according to the suggestion to use CreateDC (), but VC6 I have learned, but many People are facing the same problem, but none of them was fruitful. Is this the correct way to use GetDefaultPrinter ().

Includes Winspool.h and Windows.h.

You probably have very old SDKs. Check whether GetDefaultPrinter is defined in your winspool.h file. If not, here are the definitions:

  BOOL WINAPI GetDefaultPrinterA (LPTST pszBuffer, LPDWORD pcchBuffer); BOOL WINAPI GetDefaultPrinterW (LPWSTR pszBuffer, LPDword pcchBuffer); #ifdef UNICODE #define GetDefaultPrinter GetDefaultPrinterW #else #define GetDefaultPrinter GetDefaultPrinterA #endif //! Unicode BOOL WINAPI SetDefaultPrinterA (LPCSTR psz printer); BOOL WINAPI SetDefaultPrinterW (LPCWSTR pszPrinter); #ifdef UNICODE #define SetDefaultPrinter SetDefaultPrinterW #else #define SetDefaultPrinter SetDefaultPrinterA #endif //! UNICODE    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -