Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / October 2003



Tip: Looking for answers? Try searching our database.

COM+ Object Context in VB 6.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pavan V - 29 Oct 2003 15:41 GMT
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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.