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

C / C++ / MFC

 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 4:20
Membercoco24319-Aug-22 4:20 
SuggestionRe: DialogBox fuction not executing its procedure Pin
David Crow19-Aug-22 5:34
MemberDavid Crow19-Aug-22 5:34 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 5:40
mveRichard MacCutchan19-Aug-22 5:40 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 6:15
Membercoco24319-Aug-22 6:15 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 6:52
mveRichard MacCutchan19-Aug-22 6:52 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 7:16
Membercoco24319-Aug-22 7:16 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 9:09
mveRichard MacCutchan19-Aug-22 9:09 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24320-Aug-22 0:47
Membercoco24320-Aug-22 0:47 
Richard MacCutchan wrote:
I told you how to fix it, copy the code from my previous message into your DialogProc.

I have a lot of respect for people who waste their time to help me, so obviously I tryied what you had said to me.

Richard MacCutchan wrote:
If it still does not work for you then there is something else that you are not showing us.


I don't have nothing to not show, so I started over again:

I had created a new "empty" VC++ w32 project and added just these files below(those file are all I got to show Smile | :) ):

.cpp file:

C++
//
// Walk_Directories.cpp
//

//#include "CmnHdr.h"
#include <windows.h>  // tipul BOOL este definit in windows.h
#include "resource.h"
#include "WindowsX.h"




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

	// Associate an icon with the dialog box.
	//chSETDLGICONS(hwnd, IDI_DIRWALK, IDI_DIRWALK);
	 SendMessage(hwnd, WM_SETICON, TRUE, (LPARAM)LoadIcon(GetWindowInstance(hwnd),MAKEINTRESOURCE(IDI_DIRWALK)));                    
	 SendMessage(hwnd, WM_SETICON, FALSE, (LPARAM)LoadIcon(GetWindowInstance(hwnd),MAKEINTRESOURCE(IDI_DIRWALK)));                    

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

	return(TRUE);
}


void Dlg_OnSize ( HWND hwnd, UINT state, int cx, int cy)
{
	SetWindowPos(GetDlgItem(hwnd, IDC_TREE), NULL, 0, 0, cx, cy, SWP_NOZORDER);	
}


INT_PTR CALLBACK Dlg_Proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
	case WM_INITDIALOG:
		HANDLE_WM_INITDIALOG(hwnd, wParam, lParam, Dlg_OnInitDialog);
		break;
	case WM_COMMAND:
		if (LOWORD(wParam) == IDCANCEL)
		{
			EndDialog(hwnd, IDCANCEL);
			break;
		}
		return FALSE;
	default:
		return FALSE;

	}

	return TRUE;
}

int WINAPI WinMain(HINSTANCE hinstExe, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)
{


DialogBox(hinstExe, MAKEINTRESOURCE(IDD_DIRWALK), NULL, Dlg_Proc);

return(0);
}



.rc file:

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"



// 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



resource.h file:

C++
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by DirWalk.rc


#define IDI_DIRWALK                     400
#define IDC_TREE                        401
#define IDD_DIRWALK	                    402


// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        101
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1001
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif



I repeat, I had created a new win32 VC++ empty project and added just these 3 files.

I have to make more settings in VC++ project? Are missing some .h header files that I have to add?


( While posting these, I observed your response Richard about the compiler resource object, thank you very much
for your time trying to help me, I will continue making a hybrid application with my knowledge to continue, in meantime I hope I will find and my need it explanations about this situation, because all I want is to know the basics and then
to start with tones of wrappers and lybraries and so on )

Thank you very much.
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 
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 

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.