Thread: Undefined Referance!!

  1. #1
    Infant of C
    Join Date
    May 2010
    Karachi, Pakistan

    Undefined Referance!!

    In my code while creating a simple property sheet. I am am getting some errors. I am unable to resolve them.
    #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()
    	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;
    	psp.hInstance         = hInstance;
    //	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;
    	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;
    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.

  2. #2
    Infant of C
    Join Date
    May 2010
    Karachi, Pakistan
    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?

  3. #3
    Registered User
    Join Date
    Mar 2005
    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
    Last edited by Niara; 01-23-2012 at 01:19 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ Referance sheet and/or book
    By aaronson2012 in forum C++ Programming
    Replies: 4
    Last Post: 08-29-2008, 09:11 AM
  2. Resource Editor "ResEd" Referance Code?
    By parad0x13 in forum C++ Programming
    Replies: 0
    Last Post: 07-19-2008, 02:08 PM
  3. Referance Ifstream
    By Ajsan in forum C++ Programming
    Replies: 2
    Last Post: 05-12-2004, 02:37 PM
  4. undefined What!!
    By breed in forum C Programming
    Replies: 6
    Last Post: 01-22-2002, 05:25 PM
  5. Undefined
    By {Dnw} in forum C Programming
    Replies: 2
    Last Post: 08-27-2001, 10:30 PM