Using New to create instances of a class in MTS componant 
Author Message
 Using New to create instances of a class in MTS componant

This snippit comes from
Platform SDK: Transaction Server
Creating MTS Objects.

Can someone explain what exactly it means not to use the New keyword to
create an instance of a class in the current MTS project.....  Do they
expect me to change all of my MTS objects to use createobject?  Obviously
this would only be for public creatable classes but still...... I am trying
to still understand what this means......

--------

Important Do not use the New operator, or a variable declared As New, to
create an instance of a class that is part of the active project. In this
situation, Visual Basic uses an implementation of object creation that does
not use COM. To prevent this occurrence, it is recommended that you mark all
objects passed out from a Visual Basic componentas Public Creatable, or its
equivalent, and created with either the CreateObject function or the
CreateInstance method of the ObjectContext object.



Sat, 24 Jan 2004 23:23:05 GMT  
 Using New to create instances of a class in MTS componant
The CreateObject has implementation on the backside that you are not exposed
to that hooks into the MTS/COM+ structure that allows for proper reference
counting and thread handling.  The new operator will not generate the proper
implementation to allow MTS/COM+ to handle the object in the correct manor.
You may want to read up on these technologies to get a better understanding
of the guts before implementing them.  I think while Microsoft makes
technology that is easy to use their sales team promotes it as blackbox
(don't have to know how it works just use it).  This should never be the
case.

Steven Szelei


Quote:
> This snippit comes from
> Platform SDK: Transaction Server
> Creating MTS Objects.

> Can someone explain what exactly it means not to use the New keyword to
> create an instance of a class in the current MTS project.....  Do they
> expect me to change all of my MTS objects to use createobject?  Obviously
> this would only be for public creatable classes but still...... I am
trying
> to still understand what this means......

> --------

> Important Do not use the New operator, or a variable declared As New, to
> create an instance of a class that is part of the active project. In this
> situation, Visual Basic uses an implementation of object creation that
does
> not use COM. To prevent this occurrence, it is recommended that you mark
all
> objects passed out from a Visual Basic componentas Public Creatable, or
its
> equivalent, and created with either the CreateObject function or the
> CreateInstance method of the ObjectContext object.



Sun, 25 Jan 2004 02:12:44 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using New to create instances of a class in MTS componant

2. Creating a new instance of Winsock in a Class Module

3. Using reflection to create class instance

4. Returning Single Instance of a class from MTS

5. Dim obj As New Class crt Dim Obj As Class = New Class

6. Upgrade a componant on MTS?

7. A MTS componant client

8. Comments on my MTS componant

9. Poor performance of MTS Componant

10. Permission Denied MTS Componant

11. Compiling VB (w/ MTS componant) and running it on another machine

12. Permission Denied MTS Componant

 

 
Powered by phpBB® Forum Software