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

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

c++ - Redefined variable in the other module -