PrintDlgEx, Visual C++ 6.0, and the Platform SDK
-
I'm trying to use the PrintDlgEx method with Visual C++ 6.0. I have installed the Platform SDK (October 2002) and the include, lib, and exe directories for this are first in the directories option. But I keep getting "error C2065: 'PRINTDLGEX' : undeclared identifier." It appears the complier is not look at the stuff in my "C:\Microsoft SDK" directories. So what is required to get Visual C++ using the Platform SDK includes, libs, and exes? Thanks for all input ;) Jonathan Craig www.mcw-tech.com
-
I'm trying to use the PrintDlgEx method with Visual C++ 6.0. I have installed the Platform SDK (October 2002) and the include, lib, and exe directories for this are first in the directories option. But I keep getting "error C2065: 'PRINTDLGEX' : undeclared identifier." It appears the complier is not look at the stuff in my "C:\Microsoft SDK" directories. So what is required to get Visual C++ using the Platform SDK includes, libs, and exes? Thanks for all input ;) Jonathan Craig www.mcw-tech.com
You must define _WIN_NT 0x500 in stdafx before you include the common dialog files. This means that your application will only run on windows 2000 / xp (which is when printdlgex as added).
-
You must define _WIN_NT 0x500 in stdafx before you include the common dialog files. This means that your application will only run on windows 2000 / xp (which is when printdlgex as added).
I don't see anywhere in the SDK include files a reference to _WIN_NT. I have added
#define _WIN32_WINNT 0x0500
and#define WINVER 0x0500
to the stdafx.h file but I still get the same error. Jonathan Craig www.mcw-tech.com -
I don't see anywhere in the SDK include files a reference to _WIN_NT. I have added
#define _WIN32_WINNT 0x0500
and#define WINVER 0x0500
to the stdafx.h file but I still get the same error. Jonathan Craig www.mcw-tech.comSorry, my mistake. From CommDlg.h: #if(WINVER >= 0x0500) // // PrintDlgEx structure. // typedef struct tagPDEXA { DWORD lStructSize; // size of structure in bytes HWND hwndOwner; // caller's window handle HGLOBAL hDevMode; // handle to DevMode HGLOBAL hDevNames; // handle to DevNames HDC hDC; // printer DC/IC or NULL DWORD Flags; // PD_ flags DWORD Flags2; // reserved DWORD ExclusionFlags; // items to exclude from driver pages DWORD nPageRanges; // number of page ranges DWORD nMaxPageRanges; // max number of page ranges LPPRINTPAGERANGE lpPageRanges; // array of page ranges DWORD nMinPage; // min page number DWORD nMaxPage; // max page number DWORD nCopies; // number of copies HINSTANCE hInstance; // instance handle LPCSTR lpPrintTemplateName; // template name for app specific area LPUNKNOWN lpCallback; // app callback interface DWORD nPropertyPages; // number of app property pages in lphPropertyPages HPROPSHEETPAGE *lphPropertyPages; // array of app property page handles DWORD nStartPage; // start page id DWORD dwResultAction; // result action if S_OK is returned } PRINTDLGEXA, *LPPRINTDLGEXA; #endif That means you need to define WINVER at 0x0500 before including Windows.h or CommDlg.h.