-
July 26th, 2009, 10:06 AM
#1
[RESOLVED] Multiple Modeless Dialogs (MFC)
i have 2 dialogs , 1 is the "main" dialog and another 1 is a modeless dialog the it suppose to be opened several times simultaneously
so each time i call a new instance of the modeless dialog i do this
Code:
CManager **FM_Dialog; //global var that points to dialog class
FM_Dialog[0] = new CManager; //allocate a new instance of the dialog
FM_Dialog[0]->Create(CManager::IDD,this); //Show to user
FM_Dialog[0]->ShowWindow(SW_SHOW);
im getting an error of "Unhandled exception blah blah blah"
on this line FM_Dialog[0] = new CManager;
what im i doing wrong here?
-
July 26th, 2009, 10:10 AM
#2
Re: Multiple Modeless Dialogs (MFC)
You need to allocate space for dialog pointers, like:
#define MAX_DIALOGS 100
CManager *FM_Dialog[MAX_DIALOGS];
Or use some container:
list<CManager*> FM_Dialog;
CManager* pDialog = new CManager; //allocate a new instance of the dialog
pDialog->Create(CManager::IDD,this); //Show to user
pDialog->ShowWindow(SW_SHOW);
FM_Dialog->push_back(pDialog);
-
July 26th, 2009, 10:24 AM
#3
Re: Multiple Modeless Dialogs (MFC)
thank you Alex F
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|