0

I have developed a C# application with threads which converts word to pdf.
This application works fine in Win XP with Office 2007. But when using it on Win7 with Office 2010 its throws an error:

Creating an instance of the COM component with CLSID {00020906-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 8001010a.

Can you tell me how to make Win7 run my application?

Mukesh
  • 45
  • 3
  • 10
  • It appears to be an issue with anti-virus running on the same machine - see this [thread](http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/1f6d4b5f-fc3d-4b1b-8446-0b7ba8d82e6d) More specifically, the problem is related to the DLLs being locked down (which can be caused by anti-virus running). The problem is most likely you have the files locked by one thread and trying to access them via another. – James Sep 11 '12 at 10:23
  • i dont think that this could be the problem because my system is also installed symentech endpoint antivirus – Mukesh Sep 11 '12 at 10:29
  • if i run the program in single thread its run but if i give more than that its not working. even i disabled the antivirus. all word docs are in shared location – Mukesh Sep 11 '12 at 10:32
  • see my updated answer. You haven't said what it is you are trying to do or provided any code therefore my answer can't be any more detailed than what it is. – James Sep 11 '12 at 10:34
  • Hi james i am running same app in winxp and its work fine. both machine is having same antivirus. winxp can access through shared location but win7 is not accessing properly. this is my doubt – Mukesh Sep 11 '12 at 10:41
  • hi guys still i am waiting for the solution – Mukesh Sep 25 '12 at 12:28

1 Answers1

3

Error code 0x8001010a is RPC_E_SERVERCALL_RETRYLATER, "The object invoked chose not to process the call now. Try again later." Not uncommon for Office apps. You are supposed to sleep for a while and try again.

This is not exactly very practical, using the strongest possible understatement. Ultimately, it is caused by you using threads in your code. Office objects are single-threaded. You certainly can make a method call on a worker thread, but COM automatically marshal the call to the STA thread that created the object. Essentially removing all advantages of multi-threading. If you create your own STA thread to avoid that then the marshaling is done inside the Office app.

And that's where the buck stops, if you make a call and the app just isn't ready to execute the method because it is busy doing something else (typically with whatever you asked it to do previously) then it will reject the call with this error code. Exactly when you'll get the error is highly unpredictable, a version change certainly qualifies for different behavior. You'd have to tone down the threading in your code to avoid slamming it so hard.

Or to implement the IMessageFilter interface and tell COM that it is okay that your program hangs on the call and it should just continue waiting until the Office app is ready to process the call. This Q+A talks about it.

Community
  • 1
  • 1
Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536