PC Review


Reply
Thread Tools Rate Thread

cannot get a ref parameter on a thread

 
 
=?Utf-8?B?RGlvZ28gQWx2ZXM=?=
Guest
Posts: n/a
 
      7th May 2007
Greetings,

I have a COM reference that connects to a device to get some data... if I
don't use threads to get data i can get the "ref int events" without any
problems but if it's running inside a thread it doesn't touch on the
variable value

How can I workaround this?
 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      7th May 2007
Diogo,

What is the apartment of the COM object? More likely than not, it is an
STA threaded object, and you need to set the ApartmentState property of the
thread to ApartmentState.STA ^before^ you make any calls to COM objects.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Diogo Alves" <(E-Mail Removed)> wrote in message
news:F0CCB46C-BEE3-4CAC-AD3E-(E-Mail Removed)...
> Greetings,
>
> I have a COM reference that connects to a device to get some data... if I
> don't use threads to get data i can get the "ref int events" without any
> problems but if it's running inside a thread it doesn't touch on the
> variable value
>
> How can I workaround this?



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I pass a parameter to a new thread? rkbnair Microsoft Dot NET Framework Forms 2 29th Jan 2008 09:59 PM
Thread, parameter passing =?Utf-8?B?YnJpYW5faGFycmlz?= Microsoft VC .NET 3 19th Dec 2005 04:28 PM
Passing parameter to thread Hardy Wang Microsoft C# .NET 3 26th Apr 2005 03:04 AM
Thread procedure with parameter. Boba Microsoft C# .NET 3 2nd Jan 2004 01:48 AM
How can I send a parameter to a thread fjlpf Microsoft C# .NET 1 13th Nov 2003 02:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:17 PM.