-
Undefined Referance!!
In my code while creating a simple property sheet. I am am getting some errors. I am unable to resolve them.
Code:
#include "smsrc.h"
#include <windows.h>
#include <prsht.h>
#define NEWDIALOGCOUNT 2
BOOL CALLBACK DialogProc1(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
}
BOOL CALLBACK DialogProc2(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
}
void CreateNewUser()
{
HPROPSHEETPAGE hpsp[NEWDIALOGCOUNT];
PROPSHEETPAGE psp = { sizeof(psp) };
PROPSHEETHEADER psh = { sizeof(psh) };
psp.hInstance = hInstance;
psp.dwFlags = PSP_HIDEHEADER;
// psp.lParam = (LPARAM) &wizdata;
psp.pszHeaderTitle = NULL;
psp.pszHeaderSubTitle = NULL;
psp.pszTemplate = MAKEINTRESOURCE(IDDIALOG_NEW_1);
psp.pfnDlgProc = DialogProc1;
hpsp[0]=CreatePropertySheetPage(&psp);
psp.hInstance = hInstance;
psp.dwFlags = PSP_USEHEADERSUBTITLE | PSP_USEHEADERTITLE;
// psp.lParam = (LPARAM) &wizdata;
psp.pszHeaderTitle = "Select Location";
psp.pszHeaderSubTitle = "Select the location to save your congfiguration file";
psp.pszTemplate = MAKEINTRESOURCE(IDDIALOG_NEW_2);
psp.pfnDlgProc = DialogProc2;
hpsp[1]=CreatePropertySheetPage(&psp);
psh.hInstance = hInstance;
psh.hwndParent = NULL;
psh.phpage = hpsp;
psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
psh.pszbmWatermark = NULL;
psh.pszbmHeader = NULL;
psh.nStartPage = 0;
psh.nPages = 2;
PropertySheet(&psh);
}
I am using DEV-C++
the compiler is giving following Errors
1. PSP_HIDEHEADER was not declared in this scope
2. PSP_USEHEADERTITLE was not declared in this scope
[All the predefined directives like PSP_USEHEADERSUBTITLE and PSH_HEADER etc are said as undeclared]
3. 'struct PROPSHEETA have no member named 'pszHeaderTitle'.
4. 'struct PROPSHEETA have no memeber named 'pszHeadersubTitle'.
5. [linker] Undefined reference to CreatePrpertySheetPage
6. [linker] Undefined reference to PrpertySheet.
Plz ANy one help me.
-
Some one have just told me that I should check that the macro _WIN32_IE is set equal or greater than 0x0400.
And also I should link to Comctl32.lib.
Now the question is that how can I make sure Or check or set this macro accordingly?
Also My compiler does not have any lib file named as Comctl32.lib but it have a file named libcomctl.a are these two file equivalent?
If so then how can I link my project to it?
-
Open the prsht.h header file and search for PSP_HIDEHEADER; you'll will see that's defined for _WIN32_IE >= 0x0400, so just define _WIN32_IE before the header include and assign to it 0x0400 or greater, so when the header will be loaded it will understand that you are developing for that version (that means that your program will only work for that iexplorer version).
Then you will have to link the library; depending on the IDE you use it will be done in different ways; just check your IDE manual to see the way (if you're using devc++ just go to project -> options -> parameters -> linker).
Hope that helps
Niara