Reputation: 1499
As per the suggestion for the previous question I am trying to use the GetDefaultPrinter() and then to the CreateDC(), but the VC6 is consistently saying
error C2065: 'GetDefaultPrinter' : undeclared identifier
I tried Google but many faced the same problem, but none of them were fruitful. Is this a correct way to use the GetDefaultPrinter().
Winspool.h and Windows.h are included.
Upvotes: 1
Views: 1122
Reputation: 50883
You probably have a very old SDK. Check if GetDefaultPrinter
is defined in your winspool.h file. If not, here are the definitions:
BOOL
WINAPI
GetDefaultPrinterA (
LPSTR 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 pszPrinter
);
BOOL
WINAPI
SetDefaultPrinterW (
LPCWSTR pszPrinter
);
#ifdef UNICODE
#define SetDefaultPrinter SetDefaultPrinterW
#else
#define SetDefaultPrinter SetDefaultPrinterA
#endif // !UNICODE
Upvotes: 1