Reply

COMException: Call was rejected by callee

[ Edited ]

 

I think this issue has been mentioned before, and I wondered whether anyone could shed any more light on it, or had experience of a resolution.

 

Apologies if this is a bit vague (I can probably pull together an example if that helps) but I have a piece of code that opens a sequence of part files in turn and applies a simplification process to each one before closing it, and moving on to the next. 

 

The issue I'm having is that *randomly* I get an System.Runtime.InteropServices.COMException, with an error code of RPC_E_CALL_REJECTED, when accessing the Solid Edge API.  As I say, this is random in so much as it occurs at different places in the code where I use the Solid Edge API.

 

I have a theory (that I'm trying to confirm) that this is only an issue on multi-core systems.

 

Any information/experience anyone has of this would be appreciated.

 

Cheers

Stuart

 

Posted by: Stuart Davies
Post date: 11/16/2007 12:53:00 AM

19 REPLIES

RE: COMException: Call was rejected by callee

[ Edited ]

Meant to add that this occurs with both SE19 and SE20.

 

Posted by: Stuart Davies
Post date: 11/16/2007 3:46:16 AM

RE: COMException: Call was rejected by callee

[ Edited ]

 

Stuart,

I remember having a conversation about this with a SE developer.  He was asking me how to deal with it .

I believe I sent him to this: http://msdn2.microsoft.com/en-us/library/ms228772(VS.80).aspx

Give it a try and see if that helps.  If you need my help, just let me know.

 

Posted by: Jason Newell
Post date: 11/18/2007 8:02:05 PM

RE: COMException: Call was rejected by callee

[ Edited ]

 

Hi Jason

 

Great minds - I was just coming on here this morning to post that :-)

 

I came across that MSDN article at the weekend and implemented it accordingly, and from initial testing it seems to have done the trick. I'd already implemented something similar by catching the exception in various places and retrying the operation that caused the error (which usually worked) but the solution above is much better as it can be implemented just once within the code.

 

I'm surprised this hasn't been reported more often!

 

Cheers

Stuart

 

Posted by: Stuart Davies
Post date: 11/18/2007 8:58:27 PM

RE: COMException: Call was rejected by callee

[ Edited ]

 

Hi Jason, Hi Stuart,

i'm still struggling with the "Application busy" problem while automating Solid Edge.

I've written a multi thread application which does the Solid Edge automation in an backgroundworker process started by the GUI thread. The backgroundworker process opens sequentially (a lot of) Solid Edge data files of any of the Solid Edge data file types to proof the files against certain given criteria. Since Solid Edge V19+ there is a high chance to get that "Application busy" error. I found that error to occure mostly directly after opening a  Solid Edge file and before determining the Solid Edge data file type as type. I successed to get rid of the problem by inserting a System.Thread.Sleep(2000) call after opening a file. It worked fine on all of my test installations and mostly all sites, except at 1 customer site! The same program works fine there with Solid Edge V17, but no longer with Solid Edge V19+. So i also tried additionally the above mentioned fix from Microsoft with setting up a MessageFilter, but still did not success to get the application run properly with Solid Edge V19+. I've tried several locations in the code to place the MessageFilter.Register() and MessageFilter.Revoke() calls (in the GUI thread, in the backgroundworker thread). Maybe i've misunderstood something in properly implementing this workaraound.

Could you give me a hint how to implement this fix for the scenario of a multi thread Solid Edge automation application as described above?

Many thanks in advance!

Wolfgang Kunert

www.wksyspro.de

 

 

 

Posted by: Wolfgang Kunert
Post date: 11/19/2007 7:15:56 AM

RE: COMException: Call was rejected by callee

[ Edited ]

 

Hi Wolfgang

 

I understand your pain - I've been through exactly the same thing with trying "sleeps" and all sorts! My program isn't multi-threaded, but have you tried applying the MTAThread attribute to your program?

 

Cheers

Stuart

 

Posted by: Stuart Davies
Post date: 11/19/2007 7:34:43 AM

RE: COMException: Call was rejected by callee

[ Edited ]

 

Stuart,

Would you mind putting together a small demo application that shows us how to implement this?

 

Posted by: Jason Newell
Post date: 11/19/2007 1:15:01 PM

RE: COMException: Call was rejected by callee

[ Edited ]

Hi Jason

 

I'd be happy to - any preference between C# or VB.NET ?

 

Cheers

Stuart

 

Posted by: Stuart Davies
Post date: 11/19/2007 8:56:53 PM

RE: COMException: Call was rejected by callee

[ Edited ]

 

Both

 

Posted by: Calum McLellan
Post date: 11/19/2007 9:23:42 PM

RE: COMException: Call was rejected by callee

[ Edited ]

 

Hi Stuart, Hi Jason,

thanks for your replies.

I will try setting the mentioned attribute next week, when i will be back in my office.

Yes, any small example (no matter C# or VB.NET) would be appreciated

Best regards,

Wolfgang

www.wksyspro.de

 

Posted by: Wolfgang Kunert
Post date: 11/21/2007 9:39:04 PM