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
Nagarjuna Manchineni 2017년 6월 19일
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