473,396 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

cannot get a ref parameter on a thread

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?
May 7 '07 #1
1 1470
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]
- mv*@spam.guard.caspershouse.com

"Diogo Alves" <Di********@discussions.microsoft.comwrote in message
news:F0**********************************@microsof t.com...
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?

May 7 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: AMS | last post by:
I am trying to create a thread to execute a script for me and then display the output in notepad. What is happening is when I call the CreateThread method and pass in the Routine and Parameter...
3
by: Liu Ju | last post by:
Dear members: I want to use the multithread in my program which is developed in Visual C++ platform (version 6). I created a controlling function: UINT CCOMM1Dlg::WritingThreadFunc(LPVOID...
4
by: Morgan Cheng | last post by:
I tried to build a CThread on linux which imitate the behavior of java Thread. I think this is still in the scope of C++. First, I tried this way #include <pthread.h> class CThread { public:...
6
by: Catherine Jones | last post by:
Hi all, we need urgent help in a matter. We are trying to pass a COM object from the client to server and are facing some problems in the same. We've our client in C# as well as the Server...
3
by: Sam Learner | last post by:
Hello everyone, I am developping an application, I create a thread for the application because it is about to download a large file, and wanted it to do it inside of a thread... Now, the function...
3
by: JohnnyGr | last post by:
I have heard theres a new way to start threads with parameters in framework 2.0, does anyone know how to do that? this is what i need to do... Start a thread that executes some stuff, in this...
0
by: Luqman | last post by:
I have copied the following code from Internet, and copied it to a file named : test.aspx, and copied that file to c:\Inetpub\wwwroot Directory. When I type on my Internet explorer:...
8
by: =?Utf-8?B?V2hpdG5leSBLZXc=?= | last post by:
Hi there, I'm having a bit of trouble using an HRASCONN object as a class member variable inside my managed C++ class. When I call RasDial() and pass in the address of my HRASCONN object, I get...
2
by: phenrol | last post by:
Hello, I am having issues getting my worker thread to function properly. I am working with visual c++ 6 and I am unsure that this is the correct forum to post in but I could not find another that...
8
by: DanicaDear | last post by:
I have something interesting...looking to see if anyone else has came across this. I have a query with parameter and and the query works beautifully every time. However, when I use the wizard...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.