Advertisement Jump to content


This topic is now archived and is closed to further replies.


I need some basic help in VC++\MFC..

This topic is 5489 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

Hello. I am a very beginner programmer. My problem by now that I create a new MFC projecr in VC++6 (dialog based form).. now I need to create another dialog but I need him to appear too as I run my whole program. so I inserted a new dialog form ,related it to it''s own class, but It''s not appear on the screen ): So my question is: how do I make an additional dialog automaticly appear on a screen? thank u!

Share this post

Link to post
Share on other sites
"...but I need him to appear too as I run my whole program..."

If you want the dialog to run simulaneously with your program than you must create it modeless .
That means you cannot use DoModal() .

During the creation of your MainFrame/MainDlg or on OnInitialUpdate() create the second dialog as a child or popup window to the main dialog. This will allow it to process messages of its own as well as respond to the parent.

If you do not have a grasp on basic windows programming then refer to the MSDN->Visual C++ Documentation->Samples for further instruction.

This Should help get you started with modeless dialogs:

// Creation of a modeless dialog.

int DialogBox(
HINSTANCE hInstance, // handle to application instance

LPCTSTR lpTemplate, // identifies dialog box template

HWND hWndParent, // handle to owner window

DLGPROC lpDialogFunc // pointer to dialog box procedure


// The ending comes in two forms:

// 1. End the dialog:

BOOL EndDialog(
HWND hDlg, // handle to dialog box

int nResult // value to return

// 2. Destroy the dialog window:

BOOL DestroyWindow(
HWND hWnd // handle to window to destroy


I hope some of this helps =)

[edited by - citizen3019 on January 13, 2004 1:16:12 PM]

Share this post

Link to post
Share on other sites
thank u for trying to help me, but I am understand.. I am not understand all the window programming shit.. yet
I will attach here the code and if u have time please correct it
so the both of the dialogs will appear.

thnx very much!!!!

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!