Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have the following problem:

I am calling a C function from a C++ class. The C++ class itself is called from a managed (C#) program. The C function hides the creation of a COM object (a MATLAB engine instance in this case). Natively MATLAB is a Java application, so I _suspect_ it is not an INPTOC server.

When the C function is called it takes a while and then the "Server is too busy" dialog is shown which lets me choose either "Change to..." (the MATLAB window or "Repeat..." (something ;)). This is most likely due to the fact that the MATLAB engine has an window which prompts the user for input (a console).

My question is:

Is there any Win32/COM function that allows to prevent this dialog from appearing? Can I set any parameter (e.g. a queue size) or can I add a callback (somehow) that allows to override this behavior?


thanks in advance

Lars
Posted
Comments
Code-o-mat 13-May-14 11:06am    
Let's assume you don't get the dialog displayed, then what? Just trying to understand what your goal is.
califax2k 13-May-14 14:16pm    
Well, what I want to achieve is to instantiate the MATLAB engine and pass some strings down so that it evaluates them. But I don't want to see the "Server is too busy" dialog because this should all happen "in the background".
Code-o-mat 13-May-14 16:22pm    
Are you sure you are using whatever you are using correctly?
califax2k 13-May-14 16:41pm    
Well, there are not so many options: there's a DLL. It contains a C-function named engOpen() and it delivers an engine handle. I wrote a C++ class (in my own DLL) and in that class I call engOpen() - easy. No Problem.

I wrote even another class - this time C++/CLI which wraps the first one (because I ultimately I want to pass Information from a C# program (that uses the C++/CLI class) down to the MATLAB engine (that's been created using engOpen()) - but this is not part of the problem.

So, if you ask me, if I'm using the stuff correctly, I'd say yes: because everything links fine - and it even works. DESPITE this one tiny piece that during the engOpen() call (which takes no parameters at all) the Server is to busy dialog opens up. And this happens because a COM object (representing the MATLAB engine) is created.

I my question is: how can I prevent this dialog from appearing....that's all.
Code-o-mat 14-May-14 3:54am    
Googled around a bit and found this: http://compgroups.net/comp.soft-sys.matlab/server-busy-matlab-called-from-visual-ba/1000891
I know it's VB but might be worth a try in C++ too in case you haven't run across it yet.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900