How to display 'Loading...' in 'cmd.exe' of a standalone application before it attempts to load MCR?

2 次查看(过去 30 天)
Hello, Thank you for your attention.
I deployed an application using deploy tool. I unchecked to suppress console window (similar to 'cmd.exe' in windows 7).
My GUI start time is variable. It's fine. however, I want to display a word 'loading...' at the start of the console window and display another word: 'Loading.... completed' just after my GUI starts.
I have prepared splash image, however it never gets displayed perhaps because console starts immediately after double clicking application file.

回答(2 个)

Nagarjuna Manchineni
I believe you are trying to open an application GUI when you double click the standalone application .exe. For achieving the above behavior, wrap the call to the GUI function inside a function as follows and compile the new function.
function newwrapperfunction
disp('loading');
a = <GUI application/function>;
disp('loading completed');
end
  2 个评论
KJVKU999
KJVKU999 2017-6-20
Thank you for your answer. I tried that already, it works but not as intended.
The Problem: Console opens right away when I double click my *.exe file. It displays flashing underscore.
After 120 seconds, i.e. at 121st second, it displayed 'loading'. At 124th second, it displayed 'loading completed'. At 130th second, my GUI opens up.
Requirement:
When I double click *.exe, console should start right away (it does) and it should display 'loading'(at 1st or 2nd second). At 130th second, it should display 'loading completed'. At 131st second my GUI should start.
P.S. I don't know much about when it will load MCR and what other things it must do to start GUI. However, I think that the code I write in MATLAB will not show message in console right away when I start my *.exe, because it needs MCR to be loaded.
Is there a way to display message in console without using MCR, i.e. a script in other language that I can run to show the message, then run *.exe and when GUI opens up, the script will end?

请先登录,再进行评论。


Vladimir Kuptsov
Vladimir Kuptsov 2020-1-31
Just create a simple bat-file with two lines:
@echo loading...
@MyApp.exe
MyApp.exe - your standalone application. Use disp('loading completed') from Matlab code for the second message.
Now use this bat-file to start your application.

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler SDK 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by