There are a number of differences between code executing in the application execution context and code in other contexts. The differences are described below:
- It is not part of the command processor state of any specific document.
- It can activate different documents without immediately suspending itself, although it must complete and return before the new active document can process its input.
- AutoLISP is also disabled when prompting for user input in this context.
-
In the cases of modeless dialogs and external process-generated ActiveX requests, the code must lock the documents, including the current document. The use of the
IAcadDocument methods
StartUndoMarker() and
EndUndoMarker() will apply a
kWriteLock to the document.
- The command facility may not be used from the application execution context, specifically the
acedCommandS()/acedCommandC() and
acedCmdS()/acedCmdC() functions.
-
The
AcApDocManager::sendStringToExecute() and
AcApDocManager::activateDocument() methods change the active document but do not suspend execution of the code running under the application context. They will suspend execution of code running in a document execution context. The
AcApDocManager::sendStringToExecute() method will always queue the string when invoked from the application context, while invoking it from a document context will either queue the string if the activate parameter is
kFalse, or immediately suspend the document context if the activate parameter is
kTrue.