开发者

how to create new window in mfc project

hi im using c++ mfc. i have main window which works all the time and i want to make new window. how can i do it? thanks开发者_JS百科


Hi you can create your own dialog by VS master and then do // on some event

CMyDialog dlg;
dlg.DoMoDal();

link http://www.codersource.net/mfc/mfc-tutorials/dialog-boxes-in-mfc.aspx


  1. Create a dialog resource in the resource editor.

  2. Right click it and choose "Add Class".

  3. Make sure the parent class is "CDialog" or any other you'd like and hit ok.

  4. Visual Studio class wizard will now create the necessary files you can now override window messages...etc

Easiest way to show your new dialog by calling:

CMyNewDialog dlg;
dlg.DoModal();

and make sure you include the newly created dialog class header file, should be: MyNewDialog.h

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜