Why does my compiled standalone application sometimes stall until I press a key?

1 Ansicht (letzte 30 Tage)
I have created a standalone executable with MATLAB Compiler on Windows. I run my application using the Windows Command Prompt. Some times my application stalls for no apparent reason. Pressing any key on the keyboard, or right clicking in the Command Prompt window seems to un-stall the application.
The stall occurs at places in the code which do not make sense. For example, between two 'fprintf' statements.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 22 Jun. 2021
Bearbeitet: MathWorks Support Team am 22 Jun. 2021
This behavior may be due to a feature of the Windows Command Prompt called Quick Edit Mode.
What is Quick Edit Mode?
This is an optional feature of Command Prompt which pauses the execution of the current program when you select text in the command prompt window. This was designed to make it easier to select text.
How can I tell if my application is stalled due to Quick Edit Mode?
The most clear indicator of when Quick Edit Mode has been engaged is that the title bar of the Command Prompt window changes.
For example, under normal operation the title bar of the Command Prompt window may say: "Command Prompt". When quick edit mode is engaged, the title changes to "Select Command Prompt". If you notice that your application has stalled and the title bar of the Command Prompt window has changed in this manner, your application is most likely stalled due to quick edit mode.
Simply press a key on the keyboard with the Command Prompt window focused to un-stall the application.
How can I prevent my application from stalling due to Quick Edit Mode?
Quick Edit mode can be easily disabled for a single Command Prompt window or for all future command Prompt WIndows. Refer to the following link for more information:

Weitere Antworten (0)

Kategorien

Mehr zu Desktop finden Sie in Help Center und File Exchange

Produkte


Version

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by