Click here to Skip to main content
15,498,622 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24320-Aug-22 0:47
Membercoco24320-Aug-22 0:47 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan20-Aug-22 0:58
mveRichard MacCutchan20-Aug-22 0:58 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24320-Aug-22 1:06
Membercoco24320-Aug-22 1:06 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan21-Aug-22 2:56
mveRichard MacCutchan21-Aug-22 2:56 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24321-Aug-22 8:51
Membercoco24321-Aug-22 8:51 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan21-Aug-22 10:03
mveRichard MacCutchan21-Aug-22 10:03 
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 
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 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 
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 

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.