I've got .ma/.dll that is loaded via MS_DGNAPPS. In the .ma are callbacks for SYSTEM_NEW_DESIGN_FILE and INPUT_FILEOPENDIALOG_PREPROCESS. Once a model is opened, and File->Close is picked from the menu, the current model is closed and MicroStation returns to a "blank" window with a File Open dialog. The opening of that File Open dialog is NOT being seen by my file open preprocess. Why is that? I have no SYSTEM_RELOAD_PROGRAM for the .ma, so I'm assuming (incorrectly?) that it's still loaded and active, and should be "seeing" this event. If I pick File->New from the menu bar in the dialog, it too is not "caught" by my DGNAPPS .ma.
Thanks,
Bruce
Bruce ...
File Close unloads MicroStation. it is the only way to change user/project/interface settings, thus the next opening might have a completely other configuration than the one before. Applications loaded with MS_DGNAPPS gets unloaded and will therefore not receive any event.
You can react on the closing with a callback like this :
mdlSystem_setFunction (SYSTEM_UNLOAD_PROGRAM, my_unloadFunction); which receives a single int parameter like SYSTEM_TERMINATED_SHUTDOWN or similar.
You eventually might combine this with a combination to a previously call to your SYSTEM_NEW_DESIGN_FILE call back where state is SYSTEM_NEWFILE_CLOSE. You should keep in mind that both of them are happening for a File/Close and File/Exit command, so afaik you cannot differ between them. Maybe you could react if you app was loaded an MS_INITAPPS, but this might have other disadvantages.
HTH Michael
Could you provide your function prototype and let us know if you the function is getting called at all by: e.g. via breakpoint in the function, and/or by validating by printing out each fopenParamsP->dialogId received?