Re: System.Runtime.InteropServices.InvalidComObjectException: Com object that has been seperated from its underlying RCW cannot be used.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Are COM objects created in the separate threads?

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com


"LeelaRamaDevi.Tangella" <tl_ramadevi@xxxxxxxxxxxxxx> wrote in message
news:11b13dff7c3f42c8b9446cb59422948f@xxxxxxxxxxxxxx
> Hi,In my application am having two threads.First thraed will be running in
a
> loop.In this first thread, i am trying to create an instance of
> ManagementObjectSercher, to calculate the Physical memory size of a remote
> system.
>
> And in the second thread am trying to read an Excel file.
>
> I am trying to run the threads simultaneously.The Second thread is running
> smoothly.Its in the first thread am facing the error:
>
> "System.Runtime.InteropServices.InvalidComObjectException: Com object that
> has been seperated from its underlying RCW cannot be used.
> at System.Management.IWmiSec.
> BlessIEnumWbemClassObject(IEnumWbemClassObjectpIRnumWbemClassObject,
String
> user, String password, String authority, Int32 impersonationLevel, Int32
> authenticationLevel)
> at System.Management.ManagementScope.Secure(IEnumWbemClassObject wbemEnum)
> at System.Management.SecurityHandler.Secure(IEnumWbemClassObject enumWbem)
> at System.Management.ManagementObjectSearcher.Get()
> --End of Inner exception stack trace --
> at System.Management.ManagementException.ThrowWithExtendedInfo (Exception
e)
>
> at System.Mangement.MangementObjectSearcher.Get()
> at XlsMgmtThreads_7988.Class1.Mgmt() "
>
>
> First thread is running fine , upto 3 iteration of the for loop.But once
the
> Second thread is done, am getting this error in the first thread.
> Can anyone,pls tell me why this is happening???What could be the problem??


.



Relevant Pages

  • System.Runtime.InteropServices.InvalidComObjectException: Com object that has been seperated from it
    ... And in the second thread am trying to read an Excel file. ... smoothly.Its in the first thread am facing the error: ... BlessIEnumWbemClassObject(IEnumWbemClassObjectpIRnumWbemClassObject, String ... user, String password, String authority, Int32 impersonationLevel, Int32 ...
    (microsoft.public.dotnet.framework)
  • Re: vZOOM can handle cross-thread long-term references?
    ... You don't really want a non-polling processor thread to be able to access ... any data on a foreign thread unless you within the context of a memory ... At the end of the entire operation the first thread would contain a 1 in prefs, and the second thread would contain a in prefs. ...
    (comp.programming.threads)
  • Re: [question] read operation problem
    ... > I'm writing MPEG program using more than 2 threads. ... > First thread read MPEG data from MPEG hardware and write data to file. ... > Second thread read file and send data to client program. ...
    (comp.os.linux.development.apps)
  • Re: vZOOM can handle cross-thread long-term references?
    ... You don't really want a non-polling processor thread to be able to access ... any data on a foreign thread unless you within the context of a memory ... How first thread pass pointer p to second thread - this is separate ...
    (comp.programming.threads)
  • [question] read operation problem
    ... I'm writing MPEG program using more than 2 threads. ... First thread read MPEG data from MPEG hardware and write data to file. ... Second thread read file and send data to client program. ...
    (comp.os.linux.development.apps)