I have a strange problem with an application I'm currently developing under Windows NT. It's a VisualBasic 6.0 app that uses ActiveX Automation to control Matlab (with VB as the Automation Controller and Matlab as the Automation Server).
The first time I start up the app after a power-up, this really takes a lot of time, in the order of minutes. This behavior only appears when I run the executable, a stand-alone EXE. Running within the IDE gives no problems at all.
The time that the Matlab program starts up is fairly stable under all circumstances and is about 20 seconds. The problem occurs when I start up a user-selected M-script; specifically when the M-script receives the command to make a plot window on the screen ('handle = figure' command in Matlab). See notes at the bottom for details. This really takes minutes and the CPU load goes to 100%. Sometimes the whole system hangs and I have to give a reset. The second time a command is sent to an M-script to draw a plot on the screen, there are no problems. Then it's done in seconds. I have already tried to use VB DoEvent commands, but this does not help either.
So the problem occurs ONCE after power up of the PC, a run the stand-alone executable and a M-script is commanded to activate a plot window.
I'm not sure that it's a Window, VB or Matlab problem. Who can give me a clue what's happening here?
regards, Theo ter Meer.
Notes: 1. M-scripts that can be used by this app have to adhere to a certain format. 2. The VB code to send commands to a certain M-script is: <receipt string> = <Matlab object>.Execute("<M-script name with command argument">, e.g.: ReceiptString = objMatlab.Execute("MyMScript('init')" or : ReceiptString = objMatlab.Execute("MyMScript('plot')"