问题
We have a scenario where some .NET code is attempting to access the current instance of a COM (actually DCOM) object.
The object being accessed was developed in VB6. A current instance of it is available on the remote system, and appears to be accessed correctly from VB6 code.
Attempting to call Marshal.GetActiveObject
, specifying the class name, causes a COMException to be thrown, referencing error 800401E3 (Operation Unavailable).
The same .NET code appears to operate correctly when run on the machine hosting that DCOM component.
Can anyone suggest why this COMException is getting generated?
回答1:
Did you try to use the [STAThread] attribute in the dot net client app?
来源:https://stackoverflow.com/questions/1065101/when-calling-marshal-getactiveobject-class-id-here-what-would-cause-error-8004