|
-
Jun 13th, 2000, 07:20 PM
#1
Thread Starter
Addicted Member
Hi All
I need to write a component that be in MTS
But my Boss say that As New is not Good
And i need to use create Object
Why ??????
Thanks
Efrat
-
Jun 14th, 2000, 09:47 AM
#2
Guru
-
Jun 14th, 2000, 09:51 AM
#3
Guru
In case anyone else cares:
(If I remember correctly)
Use CreateObject (Actually, late binding) to instantiate objects that reside within the control of MTS. This allows the object contexts of both components to communicate, i.e. allow the calling component to determine whether the component being called completed successfully (via setcomplete or setabort)
Use AS NEW (early binding, but you can use CreateObject to achieve early binding, but I won't get into that) to instantiate objects that do not reside within MTS. You'll commonly use this for your ADO objects and the objectcontext objects, among others
Tom
-
Jun 15th, 2000, 11:29 AM
#4
Guru
Actually, a correction
Use early binding with createobject
example:
Code:
dim objMyObject as MyMtsObject.ClassName
dim objContext as mtxas.objectcontext
set objcontext = mtxas.getobjectcontext
set objMyObject = objContext.CreateInstance("MyMTsObject.ClassName")
objMyObject.Foo()
'etc....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|