Hi all,
We are developing COM+ business layer using Visual Basic 6.0 ActiveX Dll.
We have few doubts or please suggest the best practice for the following
Scenario.
Client.dll consists MyClient.cls, MyView.cls, MyProfile.cls, MyEntity.cls
classes.
Except MyClient.cls every class is PublicNotCreatable and Uses transaction
is properties are set. Where MyClient.cls class is Muliuse and Requires
Transaction. MyClient invokes MyClientView methods, MyClientView invokes
MyProfile so on.
My Question is every class implements ObjectControl control interface
methods such as Activate(),CanBePooled(),Deactivate(). But only MyClient
methods of Object Control was called not other class, Is it because of
publicnotCreatable
Another Question is
Case 1
Private mObjContext As COMSVCSLib.ObjectContext
Private Sub Class_Initialize()
Set mobjContext = GetObjectContext()
End Sub
Private Sub Class_Terminate()
'Cleanup code goes here.
end sub
Private Sub SomeMethod()
If Success then
mobjContext.setComplete()
else
mobjContext.setAbort()
end if
end sub
Case 2
Private mObjContext As COMSVCSLib.ObjectContext
Private Sub SomeMethod()
Set mobjContext = GetObjectContext()
If Success then
mobjContext.setComplete()
else
mobjContext.setAbort()
end if
end sub
From the above cases, which are best and safe practices?
Thanks in Advance!

Signature
Pavan V
Eire
Slava Gurevich - 30 Oct 2003 00:10 GMT
On the 1st issue, yes configured classes should be public to allow
interception to occur. Check the following link for additional tips:
http://www.discovercomplus.org/complusfaq/vb.html
On the ObjectContext issue, the 2nd scenario is proper, the 1st isn't
since GetObjectContext() is too early to call in class_initialize.
Instead you could place it in IObjectControl::Activate(), or simply
follow the 2nd scenario.
Slava Gurevich
>Hi all,
>
[quoted text clipped - 70 lines]
>
>Thanks in Advance!
Pavan V - 30 Oct 2003 11:46 GMT
Thanks
Pavan V
> On the 1st issue, yes configured classes should be public to allow
> interception to occur. Check the following link for additional tips:
[quoted text clipped - 81 lines]
> >
> >Thanks in Advance!