| Let me first say that the "launch" applications as currently
implemented is a midnight hack. The goal was to quickly provide a
mechanism for users to start other applications from the iconic map.
At the time it was implemented it wasn't even clear that it will be
shipped with the kit. We decided it was worth shipping it even though it
is quite primitive. To put it simply, this feature needs some work.
Here is what happens on vms when you add an application resource
to mcc_resource.dat:
1. main thread does a mcc_thread_create(launch_application....)
and goes back to its normal buisiness.
2. launch_application() issues a mcc_lib_spawn(), passing the
command specified in the resource file. Now the commands that
issue a CREATE/TERM/WAIT .... will execute as a subprocess of the
process created by the mcc_lib_spawn(). The /WAIT is a must,
otherwise the mcc_lib_spawn() process will execute the command
and terminate immediately, thus killing the CREATE/TERM subprocess.
3. The launch_application() thread is now blocked in the
mcc_lib_spawn() routine. This thread does not recognize alerts
until after the user exits the application, and control is returned
to mcc_lib_spawn().
This causes some bizarre side effects. For example, if I didn't
display the "can't exit mcc becuase a non-alertable application
is running" message, the user would see all windows that can be
alerted dissapear but never see the $ prompt in the window from
which the manage/e/i=d was issued.
This is because the iconic map has done a mcc_thread_join_all()
on all outstanding threads. The thread executing the non-alertable
application will not know it has been told to terminate until
after the user exits the application, and the mcc_lib_spawn() tests
for an alert.
The create/term/DETACH could have been used. I didn't because I do not
have time to play around with creating input files since the /DETACH
qualifier does not accept a command. The /INPUT qualifier would need
to be used.
It is clear to me that the error message needs to be more explicit so
the user knows exactly what the problem is. Maybe a list of
the applications that must be shut down prior to exiting the iconic map
would be enough.
/Jim
p.s. I also see the need for passing parameters to the application,
such as the entities selected. I can't guaranty that it will
be in 1.2 since it is low on my priority list.
|