Hello,
when closing the main window of the MicroStation Connect program, our MDL application gets informed by the unload-function (mdlSystem_setFunction(SYSTEM_UNLOAD_PROGRAM,...) and the exit design file function mdlSystem_setFunction(SYSTEM_EXIT_DESIGN_FILE_STATE,... Now we close all dialogs, terminate the ribbons, free all memory, but after restarting MicroStation Connect our application gets startet by MicroStation automatically. In V8i and all older MicroStation Versions our application was terminated. Perhaps this behaviour is useful for some users - but for our customers ist not sensefull. Is there a MicroStation variable to avoid starting MDLs automatically after closing MicroStation by closing the window (Alt+F4) ?
Kind regards,
Willi Spiegel
Philipp Lutz said:after restarting MicroStation CONNECT our application gets startet by MicroStation automatically
Have you customised MicroStation's user interface? I found that, if I have a custom tool palette that is opened automatically by a MicroStation CONNECT configuration, and if that tool palette has an embedded command string that references an app. (e.g. [MyApp]) then MicroStation loads MyApp.
[MyApp]
MyApp
Regards, Jon Summers LA Solutions
Hi Jon,
yes, we use a customized MicroStation user Interface. But if I start our application in a standard MicroStation Installation (just setting the MS_MDLAPPS variable), without adding ribbon menus, without WorkSet - the behaviour is the same. After Alt+F4 the program gets restartet automatically.
A colleage found a workaround by terminating our MDL program - when argv[1] is set to "MDLTASK". But I hoped there would be a better way.kind regards,
Willi
Philipp Lutz said:if I start our application in a standard MicroStation Installation (just setting the MS_MDLAPPS variable)
Why do you need to set MS_MDLAPPS? That variable points to a list of one or more folders where MicroStation applications (*.ma and *.dll) files are to be found.
MS_MDLAPPS
*.ma
*.dll
Configuration variable MS_DGNAPPS optionally specifies a list of applications to be started when a DGN file is opened.
MS_DGNAPPS
we use a ribbon bar to start several modules by name. If the MS_MDL and MS_MDLAPPS variable does not include our program path, the application is not restarted at MicroStation program start automatically - probabely because MicroStation does not find it.
But it seems to be impossible, to terminate a running MDL application program correctly, when MicroStation is shut down.
kind regards,Willi
Philipp Lutz said:it seems to be impossible, to terminate a running MDL application program correctly, when MicroStation is shut down
Does your app. behave differently when using Alt-F4 rather than using, for example, menu File|Exit to shut down MicroStation?
no, there is no difference between menu File|Exit and Alt+F4
Philipp Lutz said:we use a ribbon bar to start several modules by name
What is the data or code behind that customisation?
the restart problem happens also without using any application ribbon menus. If we would renounce to use the MS_MDL variable (and hide the programs for MicroStation), we would avoid this problem. So far, thanks for your helpfull tip, Otherwise there are some moduls, which start other application modules... and we would have to start them by absolute path names and not (as now) by the program name only.
Kind regards,Willi
Philipp Lutz said:the restart problem happens also without using any application ribbon menus
Well, you're describing behaviour that I haven't seen, except when a custom toolbox references my app. (and that happens only with CONNECT).
Clearly, there's something more complex going on. But I've run out of ideas to diagnose your problem!
Jon Summers said:But I've run out of ideas to diagnose your problem!
I agree, have no ideas also ;-)
I hope Robert Hook or someobdy else will be able to provide more details about internal processes.
Sometimes, without enough knowledge (or just because not reading help attentively enough ;-) new features can easily be recognized as bug (or dark magic).
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jon, Hi Jan,
thanks for your time! I will use the workaround (check argv[1] for "MDLTASK") and if so, dont start the program.
Philipp Lutz said:I will use the workaround (check argv[1] for "MDLTASK") and if so, dont start the program.
Well, but it's still "only" workaround.
It would be nice to know internal rules when, based on what setting or code, an application is loaded automatically.
Hello Jan, Hello Jon,
in the meantime we found, that closing all Toolbox windows by
mdlSystem_setFunction(SYSTEM_EXIT_DESIGN_FILE_STATE, (MdlFunctionP)storeAllOpenToolboxPositionsAndCloseBoxes);
is a working solution to realy terminate the application when MicroStation is shut down. It will not be restartet by MicroStation automatically.again Thanks for your help!