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;
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);
Bookmarks