Book a Demo

Author Topic: Server is busy in EA  (Read 5744 times)

blue5teel

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Server is busy in EA
« on: January 21, 2009, 07:32:27 pm »
Hello there,
some time ago i posted about a "server is busy"-dialog when i used ms word in my C#-addin (reporting-addin) for EA. I didnt find a solution for it.

Now i have a simliar problem with EA itself.

My addin exports the currently opened project, starts a second instance of EA and imports the lately exported project into it.
Then i apply the RTF-Documentation of EA to several packages in the second instance of EA. If the computation takes to much time a dialog appears with the message "server is busy" and the execution stops until i press "retry" on the dialog. How can i prevent this Dialog from popping up.

Why do i use a second instance of EA and not the original one:
I move elements and diagrams between packages. I had some problems after restoring the original locations of the elements: i didnt get the original structure back, but a persistent projectstructure is critical.

thank you in advance.

« Last Edit: January 21, 2009, 07:38:19 pm by blue5teel »

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Server is busy in EA
« Reply #1 on: January 21, 2009, 07:58:16 pm »
You could try to start a second thread in C# and there open the second EA instance, import stuff into it, run reports and so on. This should rid you of the dialog for good.

Could mean some work though. You'd have to test what happens when you close the first EA instance while the second thread is still running, and if your AddIn needs to know when the second thread has finished, you'll have to work with events. Some experience with threading, COM interop and asynchronous programming would be required, but I know of no other way to get rid of the "server busy" dialog.

blue5teel

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Server is busy in EA
« Reply #3 on: January 23, 2009, 08:02:45 pm »
And does it work? The way I understand it, the link shows how to set a message filter for a .Net form, but how do you set it for EA's main window?

blue5teel

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Server is busy in EA
« Reply #4 on: January 23, 2009, 09:21:06 pm »
Yes it seems to work.. I didnt get any "server is busy"-dialogs since i integrated the IMessageFilter-Interface.

You seem to speak german:
I wrote some details in this forum:
http://www.c-plusplus.de/forum/viewtopic-var-t-is-232291.html

But i actually did copy and paste from the page i mentioned in my post above.


Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Server is busy in EA
« Reply #5 on: January 23, 2009, 09:44:53 pm »
Does that mean your C# class (the public one which EA creates as COM object) implements IMessageFilter?

blue5teel

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Server is busy in EA
« Reply #6 on: January 29, 2009, 10:12:37 pm »
Quote
Does that mean your C# class (the public one which EA creates as COM object) implements IMessageFilter?

No, i created a class MessageFilter which implements IMessageFilter.
Then i integrated it in the EA_MenuClick-function in the main class (the one you are speaking of) like this:

Code: [Select]
public void EA_MenuClick(EA.Repository Repository, string Location, string MenuName, string ItemName)
        {
            switch (ItemName)
            {
                case "&Dokument erstellen":

                    using (MessageFilter messageFilter = new MessageFilter())
                    {
                        // original contents are unchanged

                        ReportForm rf = new ReportForm();
                        rf.Show();
                    }
                    break;
              }
}

Greetings
« Last Edit: January 29, 2009, 10:13:48 pm by blue5teel »

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Server is busy in EA
« Reply #7 on: January 29, 2009, 11:32:14 pm »
Thank you. That's an interesting piece of code.