EDIT: Well ok, I did another test and realized that the problem must be located somewhere else. I need to dig into the code some more to find the problem. Thanks for your suggestions guys.
Well I agree that that else should have been there, i've been changing a lot of things trying to figgure out the problem. It was there at one point.
Regardless, with the else added I still have the same problem. VS says that the problem occurs when I call.
MapPropDlg.DoModal();
This makes the problem make even less sense. I will try to explain.
Here is the function that calls the dialog box. It occurs when the user selects View Map Properties from the toolbar.
void CNZEditDoc::OnViewMapProps(){ CNZViewMapProperties MapPropDlg; MapPropDlg.SetActiveMap(pMap); MapPropDlg.DoModal();}And here is the updates version of SetActiveMap void CNZViewMapProperties::SetActiveMap(MAP* mapptr) { if(mapptr != NULL) pMap = mapptr; if(pMap->GetMapName() == NULL) ::MessageBox(NULL, "I get it", "Error", MB_OK); else ::MessageBox(NULL, pMap->GetMapName(), "Map Name", MB_OK);}
As you can see from the first method, the SetActiveMap method is called before DoModal(). Yet VS tells me the problem occurs on the call to DoModal, which should mean SetActiveMap completed successfully. When I run the program however, no message box appears telling me anything. The SetActiveMap method has to generate at least one MessageBox yet I get nothing.
Now I am thourally confused.
Will Reynard
[edited by - AcidInjury on March 30, 2004 1:45:05 PM]