I can't believe I didn't find this in the archives, but when I follow the instructions in TN02 - Correctly using DEVMODE ... I receive a compiler error when I include winspool.h. The error is "error C2733: second C linkage of overloaded function 'SetDefaultPrinterA' not allowed". I notice that CdIntf210.h has the same function name.
What is the solution here?
Thank you.
SetDefaultPrinter name collision
SetDefaultPrinter collision
I've also feaced with this problem.
With an eMail I've sdviced the support that SetDefaultPrinter is a Win32 SDK function, but they send me a small project without problem.
Of course they don't link Winspool.lib, so there are no conflict
You have 2 options:
1) Use LoadLibrary and rename the function
2) Patch library, DLL and H and change from SetDefaultPrinter to some other name (but be aware of order, I use SetDefaultPrinpdf to maintain the same naming order)
I've choose the second way, but this lead to manual install and re-patch every version.
I hope thay change the code in a future release (at least for VC users)
Hope this help.
With an eMail I've sdviced the support that SetDefaultPrinter is a Win32 SDK function, but they send me a small project without problem.
Of course they don't link Winspool.lib, so there are no conflict
You have 2 options:
1) Use LoadLibrary and rename the function
2) Patch library, DLL and H and change from SetDefaultPrinter to some other name (but be aware of order, I use SetDefaultPrinpdf to maintain the same naming order)
I've choose the second way, but this lead to manual install and re-patch every version.
I hope thay change the code in a future release (at least for VC users)
Hope this help.
Davide Zaccanti