Click here to Skip to main content
15,867,686 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
Comed back with the differences:

Automated .rc file produced by VC with code introduced by me in bad position:


C++
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (United States) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1

#ifdef APSTUDIO_INVOKED


// Icon                                           
// Icon with the lowest ID value placed first to ensure      
// application icon remains consistent on all systems.      
IDI_DIRWALK ICON DISCARDABLE "DirWalk.Ico"                  
                                             <---*******THIS BOLDED TEXT IS IN THE APSTUDIO_INVOKED DEFINITION
                                <---***** it shouln not be here
                                <---*****  THIS WAS THE FATAL ERROR   
                                                              |   
                                                              |
                                                              V                                                                              
// Dialog                                                       
IDD_DIRWALK DIALOG DISCARDABLE 10, 18, 250, 250                 
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP|
              WS_VISIBLE| WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | DS_MODALFRAME
CAPTION "Directory Walk"
FONT 8, "System"
BEGIN
       LISTBOX     IDC_TREE,0,0,0,0,NOT LBS_NOTIFY |
	                      LBX_NOINTEGRAL_HEIGHT | NOT WS_BORDER |
			   WS_VSCROLL | WS_HSCROLL | WS_GROUP |
			   WS_TABSTOP 
END



/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE  
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE  
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE  
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED

#endif    // English (United States) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED



So, the dialog definition was placed wrong, inside the APSTUDIO definition and for this reason the DialogBox were failing.
That was the super thing that was busted my brains and others time.

And that LBX_NOINTEGRALHEIGHT generated from VC must transformed in LBS_NOINTEGRALHEIGHT, as you were saying Richard

I almost forgot, this is the code from the book:

C++
//
// DirWalk.rc
//

#include "Resource.h"

#define APSTUDIO_READONLY_SYMBOLS

// Generated from the TEXTINCLUDE 2 resource.
#include "afxres.h"

#undef APSTUDIO_READONLY_SYMBOLS

// U.S. English resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif // _WIN32

// Icon
// Icon with the lowest ID value placed first to ensure
// application icon remains consistent on all systems.
IDI_DIRWALK ICON DISCARDABLE "DirWalk.Ico"

// Dialog
IDD_DIRWALK DIALOG DISCARDABLE 10, 18, 250, 250
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
		WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "Directory Walk"
FONT 8, "System"
BEGIN
	LISTBOX		IDC_TREE,0,0,0,0,NOT LBS_NOTIFY |
   				LBS_NOINTEGRALHEIGHT | NOT WS_BORDER |
            	WS_VSCROLL | WS_HSCROLL | WS_GROUP |
            	WS_TABSTOP
END

#ifdef APSTUDIO_INVOKED

// Textinclude
1 TEXTINCLUDE DISCARDABLE
BEGIN
	"Resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE
BEGIN
	"#include ""afxres.h""\r\n"
   "\0"
END

3 TEXTINCLUDE DISCARDABLE
BEGIN
	"\r\n"
   "\0"
END

#endif 	// APSTUDIO_INVOKED

#endif	// U.S. English Resources

#ifndef APSTUDIO_INVOKED

#endif 	// not APSTUDIO_INVOKED


Remains still the listbox, that is't displayed yet, I don't still know why but now I have hope.

Thank you,
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 
AnswerRe: macro function definition Pin
Mircea Neacsu18-Aug-22 2:06
Mircea Neacsu18-Aug-22 2:06 
GeneralRe: macro function definition Pin
coco24318-Aug-22 2:08
coco24318-Aug-22 2:08 
AnswerRe: macro function definition Pin
coco24318-Aug-22 2:06
coco24318-Aug-22 2:06 
GeneralRe: macro function definition Pin
Mircea Neacsu18-Aug-22 2:18
Mircea Neacsu18-Aug-22 2:18 
GeneralRe: macro function definition Pin
coco24318-Aug-22 2:43
coco24318-Aug-22 2:43 
GeneralRe: macro function definition Pin
Mircea Neacsu18-Aug-22 2:53
Mircea Neacsu18-Aug-22 2:53 
GeneralRe: macro function definition Pin
coco24318-Aug-22 3:30
coco24318-Aug-22 3:30 
GeneralRe: macro function definition Pin
Richard MacCutchan18-Aug-22 4:28
mveRichard MacCutchan18-Aug-22 4:28 
GeneralRe: macro function definition Pin
coco24318-Aug-22 4:46
coco24318-Aug-22 4:46 
GeneralRe: macro function definition Pin
Richard MacCutchan18-Aug-22 4:50
mveRichard MacCutchan18-Aug-22 4:50 
GeneralRe: macro function definition Pin
coco24318-Aug-22 5:18
coco24318-Aug-22 5:18 

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.