Click here to Skip to main content
15,501,294 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24321-Aug-22 11:16
Membercoco24321-Aug-22 11:16 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24322-Aug-22 10:58
Membercoco24322-Aug-22 10:58 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan22-Aug-22 22:22
mveRichard MacCutchan22-Aug-22 22:22 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan23-Aug-22 1:23
mveRichard MacCutchan23-Aug-22 1:23 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24323-Aug-22 7:30
Membercoco24323-Aug-22 7:30 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan20-Aug-22 0:14
mveRichard MacCutchan20-Aug-22 0:14 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 5:48
mveRichard MacCutchan19-Aug-22 5:48 
Questionmacro function definition Pin
coco24318-Aug-22 2:43
Membercoco24318-Aug-22 2:43 
Hi,

I am trying implementing this function:

C++
BOOL Dlg_OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
	RECT rect;

	// Associate an icon with the dialog box.
	chSETDLGICONS(hwnd, IDI_DIRWALK, IDI_DIRWALK);



	return(TRUE);
}


But the compiler give me this error: error C2065: 'strucure' : undeclared identifier, suggesting me that
the error is at the chSETDLGICONS.

The chSETDLGICONS is defined as a macro in a .h file:

C++
#define chINITSTRUCT(structure, fInitSize)                       \
        (ZeroMemory(&(strucure), sizeof(structure)),             \
	fInitSize ? (*(int*) &(structure) = sizeof(structure)) : 0)

// Dialog Box Icon Setting Macro

#define chSETDLGICONS(hwnd, idiLarge, idiSmall)                  \
		{                                                              \
		OSVERSIONINFO VerInfo;                                      \
		chINITSTRUCT(VerInfo, TRUE);                             \
		GetVersionEx(&VerInfo);                                  \
		if ((VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) &&   \
			(VerInfo.dwMajorVersion <=3 &&                      \
			VerInfo.dwMinorVersion <= 51))                       \
		{                                                        \
			SetClassLong(hwnd, GCL_HICON, (LONG)                      \
				LoadIcon(GetWindowInstance(hwnd),                \
				MAKEINTRESOURCE(idiLarge)));                     \
		}                                                        \
		else                                                    \
		 {                                                       \
			 SendMessage(hwnd, WM_SETICON, TRUE, (LPARAM)        \
				 LoadIcon(GetWindowInstance(hWnd),                    \
				 MAKEINTRESOURCE(idilarge)));                    \
			 SendMessage(hWnd, WM_SECTION, FALSE, (LPARAM)       \
				 LoadIcon(GetWindowInstance(hwnd),                    \
				 MAKEINTRESOURCE(idiSmall)));                    \
		}                                                        \
	}


From what I am seeing, structure is an identifier used in chINITSTRUCT function that is used in chSETDLGICONS, and I don't know how to repair that error.


Please help me with this.

Thank you in advance.
AnswerRe: macro function definition Pin
Mircea Neacsu18-Aug-22 3:06
mvaMircea Neacsu18-Aug-22 3:06 
GeneralRe: macro function definition Pin
coco24318-Aug-22 3:08
Membercoco24318-Aug-22 3:08 
AnswerRe: macro function definition Pin
coco24318-Aug-22 3:06
Membercoco24318-Aug-22 3:06 
GeneralRe: macro function definition Pin
Mircea Neacsu18-Aug-22 3:18
mvaMircea Neacsu18-Aug-22 3:18 
GeneralRe: macro function definition Pin
coco24318-Aug-22 3:43
Membercoco24318-Aug-22 3:43 
GeneralRe: macro function definition Pin
Mircea Neacsu18-Aug-22 3:53
mvaMircea Neacsu18-Aug-22 3:53 
GeneralRe: macro function definition Pin
coco24318-Aug-22 4:30
Membercoco24318-Aug-22 4:30 
GeneralRe: macro function definition Pin
Richard MacCutchan18-Aug-22 5:28
mveRichard MacCutchan18-Aug-22 5:28 
GeneralRe: macro function definition Pin
coco24318-Aug-22 5:46
Membercoco24318-Aug-22 5:46 
GeneralRe: macro function definition Pin
Richard MacCutchan18-Aug-22 5:50
mveRichard MacCutchan18-Aug-22 5:50 
GeneralRe: macro function definition Pin
coco24318-Aug-22 6:18
Membercoco24318-Aug-22 6:18 
GeneralLearning the Win API Pin
trønderen18-Aug-22 7:58
Membertrønderen18-Aug-22 7:58 
GeneralRe: Learning the Win API Pin
coco24318-Aug-22 9:38
Membercoco24318-Aug-22 9:38 
AnswerRe: macro function definition Pin
coco24318-Aug-22 3:21
Membercoco24318-Aug-22 3:21 
GeneralRe: macro function definition Pin
coco24318-Aug-22 3:37
Membercoco24318-Aug-22 3:37 
AnswerRe: macro function definition Pin
Richard MacCutchan18-Aug-22 4:38
mveRichard MacCutchan18-Aug-22 4:38 
GeneralRe: macro function definition Pin
coco24318-Aug-22 4:50
Membercoco24318-Aug-22 4:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.