Click here to Skip to main content
15,884,473 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Need insight as to how VS2008 parses vcproj files Pin
Mircea Neacsu21-Aug-22 10:35
Mircea Neacsu21-Aug-22 10:35 
GeneralRe: Need insight as to how VS2008 parses vcproj files Pin
charlieg22-Aug-22 0:56
charlieg22-Aug-22 0:56 
GeneralRe: Need insight as to how VS2008 parses vcproj files Pin
Mircea Neacsu22-Aug-22 1:45
Mircea Neacsu22-Aug-22 1:45 
GeneralRe: Need insight as to how VS2008 parses vcproj files Pin
charlieg22-Aug-22 1:53
charlieg22-Aug-22 1:53 
AnswerRe: Need insight as to how VS2008 parses vcproj files Pin
charlieg28-Mar-23 9:40
charlieg28-Mar-23 9:40 
QuestionDialogBox fuction not executing its procedure [SOLVED] Pin
coco24318-Aug-22 23:39
coco24318-Aug-22 23:39 
AnswerRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 0:38
mveRichard MacCutchan19-Aug-22 0:38 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 1:14
coco24319-Aug-22 1:14 
Thank you for your response, unfortunately not DS_MODALEFRAME is the problem

The problem is ( I think ), that when DialogBox function is called in WinMain, its associated procedure function Dlg_ProcDlg_Proc isn't executed.


Richard MacCutchan wrote:
And your message handlers could contain anything - we cannot see the code.


Are you reffering to Dlg_OnInitDialog as message handlers? It's code is:

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

	// Associate an icon with the dialog box.
	chSETDLGICONS(hwnd, IDI_DIRWALK, IDI_DIRWALK);
    
    // here is some code that I didn't got to, or have patience to write

	GetClientRect(hwnd, &rc);
	SetWindowPos(GetDlgItem(hwnd, IDC_TREE), NULL, 0, 0, rc.right, rc.bottom, SWP_NOZORDER);

	return(TRUE);
}


And the macro for chSETDLGICONS(hwnd, IDI_DIRWALK, IDI_DIRWALK); Big Grin | :-D is:

<pre lang="C++">

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

// Dialog Box Icon Setting Macro
// The call to SetClassLong is for Windows NT 3.51 or less.
// The WM_SETICON messages are for Windows NT 4.0 and Win 95
#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_SETICON, FALSE, (LPARAM)       \
				 LoadIcon(GetWindowInstance(hwnd),                    \
				 MAKEINTRESOURCE(idiSmall)));                    \
		}                                                        \
	}


But the program dosen't reach the Dlg_OnInitDialog, I placed a breakpoint there.

What do I miss? If it is really necessary for the clearness of the code I wll add and the macros in code.

And guys please don't get upset on me because I insist to solve this old kind of program, but I am curious about this different style of managing windows messages and please help me to go through.

Thank you Smile | :)
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 

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.