开发者

how to create new window in mfc project

开发者 https://www.devze.com 2023-02-03 01:29 出处:网络
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?

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

精彩评论

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

关注公众号