Jump to content
  • Advertisement
Sign in to follow this  
Mortizar

win32 dialog problem

This topic is 4502 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

First off I am using VS .Net to make the dialog templete. This is not the first time i have done this and all the others in my program do not have this problem. The problem I am haveing is this, I have use the CreateDialog() function to make a dialog box. However, all that apears is the static text the dialog its self is never drawn. I set the flags using VS's gui interface to Visiable = true and Disabled = false. The style = Child. First i will the CreateDialog function i use in my program

	CreateProgressDialog = CreateDialog(hInst, (LPCTSTR)IDD_CREATE_MAP_PROGRESS,
				         hWnd, (DLGPROC)CreateMapProgress);
Next is the DLGPROC CreateMapProgress, nothing is there really

LRESULT CALLBACK CreateMapProgress(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {

	switch(message) {

		case WM_INITDIALOG:
			
			break;

		case WM_DESTROY:

			break;
	}//end message switch
	return TRUE;
}//end CreateMapProgress


I have no idea why the dialog itself is not showing and am completely stumped on this problem and welcome anyone who can give me something to go on to fix this.

Share this post


Link to post
Share on other sites
Advertisement
Dont set the child property. Child windows are shown in the client area of their parents. Your dialog is not a child window - your dialog is owned by your window. The difference is subtled and not accurately noted in the MSDN.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
you also can't do "(LPCTSTR)IDD_CREATE_MAP_PROGRESS" that. you have to use the MAKEINTRESOURCE macro, which does a little more than just cast to a c-string (it actually does 2 casts to make sure the resulting c-string is null-terminated).
Y-Go

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
you also need to close down the dialog box by issuing an EndDialog call, typically while handling the IDOK and IDCANCEL WM_COMMAND msgs. otherwise your modal dialog box will not go away.

Share this post


Link to post
Share on other sites
CreateDialog() creates a modeless dialog, DialoxBox() creates a modal one. his message proc still has a problem though -- it should return FALSE if the message isn't handled or the default is required. his always returns TRUE.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!