Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Support COM+ constructor strings in serviced components

Total Hit ( 2800)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


Having a VB6 component support a COM+ construction string requires that you implement the IObjectConstruct interface and its only method, Construct. The .NET ServicedComponent class implements this interface internally and expose the Construct method as a protected, overridable method. Thus your VB.NET component can learn what constructor string has been passed to it in a very simple way:

Click here to copy the following block
Imports System.EnterpriseServices

Public Class BankTransfer
  Inherits ServicedComponent

  Protected Overrides Sub Construct(ByVal s As String)
    ' the argument contains the constructor string
  End Sub
End Class

The Construct method is automatically invoked after the constructor method, provided that the "Enable object constructor" option is selected in the component's Activation tab. To ease the installation step you can decorate the class with a ConstructionEnabled attribute, so that this option is automatically selected when the component is imported in a COM+ application:

Click here to copy the following block
<ConstructionEnable(True, Default:="your default constructor string")> Public _
  Class BankTransfer
  '....
End Class

The constructor string passed in the attribute is used to provide a default string for the corresponding field in the Activation tab, but in most cases it will be overwritten after the component is imported in the COM+ application. After the component has been imported, this attribute has no effect.


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.