Re: System.Runtime.InteropServices.InvalidComObjectException: Com object that has been seperated from its underlying RCW cannot be used.
- From: "Vadym Stetsyak" <vadym_s@xxxxxxx>
- Date: Thu, 20 Oct 2005 18:51:17 +0300
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??
.
- References:
- Prev by Date: Re: Thread Limits
- Next by Date: Re: Accuracy of System.Diagnostics.Stopwatch
- Previous by thread: System.Runtime.InteropServices.InvalidComObjectException: Com object that has been seperated from its underlying RCW cannot be used.
- Next by thread: memory could not be read hotfix?
- Index(es):
Relevant Pages
|