VB-COM Threading Model 
Author Message
 VB-COM Threading Model

When desinging a ActiveX dll component, there are only
two options for Threading Model (in Project Properties
page), Apartment Threaded and Single Threaded.

After compiling the component and installing it into
COM+,  I checked its Properties in Concurrency tab and it
shows Single Thread Apartment at Threading Model no matter
what Threading Model I selected when designing the
component.

Do it means that Apartement Threaded and Single Threaded
are same for VB ActiveX dll?

Thanks

Keith



Mon, 14 Feb 2005 01:10:33 GMT  
 VB-COM Threading Model

Quote:

> When desinging a ActiveX dll component, there are only
> two options for Threading Model (in Project Properties
> page), Apartment Threaded and Single Threaded.

> After compiling the component and installing it into
> COM+,  I checked its Properties in Concurrency tab and it
> shows Single Thread Apartment at Threading Model no matter
> what Threading Model I selected when designing the
> component.

> Do it means that Apartement Threaded and Single Threaded
> are same for VB ActiveX dll?

So, it only means that MTS/COM+ was written by sneering C bigots.
If you want your components to be first class citizens in COM+,
you have little choice but to use MSVC- and *only* MSVC-.

--
Joe Foster <mailto:jlfoster%40znet.com>  Sign the Check! <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Mon, 14 Feb 2005 06:15:25 GMT  
 VB-COM Threading Model
Hi Keith,

"Single threaded" aka main threaded setting is a legacy setting which
you should not use for COM+ components.  It basically means that only
the thread which created the instance can execute the code.

With the  "Apartment Treaded" setting under COM+ it is possible for
other threads ( from the STA pool) to execute the code, but still,
generally, the code could only be executed by one thread at a time.
This is why the available COM+  concurrency settings are limited.  

Both threading settings are essentially different flavors of the same
thing ( STA), and therefore COM+ explorer shows Single Thread
Apartment at Threading Model no matter  Threading Model you select in
VB.

You must always set your COM+  VB project to  "Appartment Treaded",
and check "Retain in memory".

Slava



Quote:
>When desinging a ActiveX dll component, there are only
>two options for Threading Model (in Project Properties
>page), Apartment Threaded and Single Threaded.

>After compiling the component and installing it into
>COM+,  I checked its Properties in Concurrency tab and it
>shows Single Thread Apartment at Threading Model no matter
>what Threading Model I selected when designing the
>component.

>Do it means that Apartement Threaded and Single Threaded
>are same for VB ActiveX dll?

>Thanks

>Keith



Thu, 17 Feb 2005 19:44:27 GMT  
 VB-COM Threading Model
sounds to me it is better to design COM+ components by
VC++ to achieve best performance.

Thanks all of you advice.

Quote:
>-----Original Message-----
>Hi Keith,

>"Single threaded" aka main threaded setting is a legacy
setting which
>you should not use for COM+ components.  It basically
means that only
>the thread which created the instance can execute the
code.

>With the  "Apartment Treaded" setting under COM+ it is
possible for
>other threads ( from the STA pool) to execute the code,
but still,
>generally, the code could only be executed by one thread
at a time.
>This is why the available COM+  concurrency settings are
limited.  

>Both threading settings are essentially different flavors
of the same
>thing ( STA), and therefore COM+ explorer shows Single
Thread
>Apartment at Threading Model no matter  Threading Model
you select in
>VB.

>You must always set your COM+  VB project to  "Appartment
Treaded",
>and check "Retain in memory".

>Slava

>On Wed, 28 Aug 2002 10:10:33 -0700, "keith"


- Show quoted text -

Quote:

>>When desinging a ActiveX dll component, there are only
>>two options for Threading Model (in Project Properties
>>page), Apartment Threaded and Single Threaded.

>>After compiling the component and installing it into
>>COM+,  I checked its Properties in Concurrency tab and
it
>>shows Single Thread Apartment at Threading Model no
matter
>>what Threading Model I selected when designing the
>>component.

>>Do it means that Apartement Threaded and Single Threaded
>>are same for VB ActiveX dll?

>>Thanks

>>Keith

>.



Sun, 20 Feb 2005 03:04:47 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ASP COM Dictionary Objects and Threading Model

2. How to get MTA threading model for vb.net

3. VB.net Threading Model Question...

4. VB 5 and Threading Model 'Both'

5. Threading Model In VB

6. Threading Models in VB ActiveX Exe

7. VB DLL registering with wrong threading model.

8. Threading Models in VB

9. VB Threading Model & ASP

10. VB COM+ components and Ado free thread model

11. VB-VBScript COM Threading

12. Lost threads in VB-Com component

 

 
Powered by phpBB® Forum Software