create a COM object which supports threading

U

unknown;

hello,

i've two projects. One is a (native) C++ project building as a COM.
the other one is a VB.NEt project which will use the COM object.

both are written in Visual Studio 2005


when i call in VB.NET a function in C++ it all works fine. but this
function will take about 1 or 2 minutes and in the mean time i want to
access some properties (from the same COM object).

I thought i could fix this with a thread in VB.NET ending up with
something like this.
( i know this is VB.NET code, but it's only to explain my problem)

1) Dim a As COMLib.IcomClass = New COMLib.comClass
2) Dim t As Thread
3) t = New Thread(AddressOf a.functionIwantToCall)
4) t.Start()
5) dim i as integer
6) i = a.integerProperty

when i start my thread (4) this will work. my COM function will execute
but when this thread was started my application will not execute 5 and
6 till the COM function is finished. i think this is because VB.NET
can't execute a part of the function because it isn't a real part of my
VB.NET application

my question: how do i make a COM object which will support threading?
or how do i solve this problem?

thank you
 
I

Ian Collins

unknown; said:
hello,

i've two projects. One is a (native) C++ project building as a COM.
the other one is a VB.NEt project which will use the COM object.
Off topic here, try a windows programming group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top