Click here to Skip to main content
15,913,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 1:47
mveRichard MacCutchan19-Aug-22 1:47 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 2:03
coco24319-Aug-22 2:03 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 2:29
mveRichard MacCutchan19-Aug-22 2:29 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 2:57
coco24319-Aug-22 2:57 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 3:20
coco24319-Aug-22 3:20 
SuggestionRe: DialogBox fuction not executing its procedure Pin
David Crow19-Aug-22 4:34
David Crow19-Aug-22 4:34 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 4:40
mveRichard MacCutchan19-Aug-22 4:40 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 5:15
coco24319-Aug-22 5:15 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 5:52
mveRichard MacCutchan19-Aug-22 5:52 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 6:16
coco24319-Aug-22 6:16 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 8:09
mveRichard MacCutchan19-Aug-22 8:09 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 23:47
coco24319-Aug-22 23:47 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 23:58
mveRichard MacCutchan19-Aug-22 23:58 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24320-Aug-22 0:06
coco24320-Aug-22 0:06 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan21-Aug-22 1:56
mveRichard MacCutchan21-Aug-22 1:56 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24321-Aug-22 7:51
coco24321-Aug-22 7:51 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan21-Aug-22 9:03
mveRichard MacCutchan21-Aug-22 9:03 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24321-Aug-22 10:16
coco24321-Aug-22 10:16 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24322-Aug-22 9:58
coco24322-Aug-22 9:58 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan22-Aug-22 21:22
mveRichard MacCutchan22-Aug-22 21:22 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan23-Aug-22 0:23
mveRichard MacCutchan23-Aug-22 0:23 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24323-Aug-22 6:30
coco24323-Aug-22 6:30 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 23:14
mveRichard MacCutchan19-Aug-22 23:14 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 4:48
mveRichard MacCutchan19-Aug-22 4:48 
Questionmacro function definition Pin
coco24318-Aug-22 1:43
coco24318-Aug-22 1: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.

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.