Click to See Complete Forum and Search --> : Automating COM+ registration using the COMAdminCatalog


Peter542
August 28th, 2000, 07:49 PM
Hi all,
Just wondering if anyone can provide me with some insight as to setting properties of components.
I made a quick VB app that registers the dll in COM+ services using the COMAdminCatalog... However, I would also like to set the activation properties and automate the constructor string as well. Can anyone help me with this? I found the example that helped me register the components however, there doesn't seem to be any info on setting the constructor string. If anyone could show me some sample code or reference links to automate this process, it would be much appreciated.
Thanks
Peter Lee

L.F.C
May 13th, 2005, 10:52 AM
Hi,

I wrote a vbscript for this propose, see below :

Function SetConstructorString(strAppId, strCompName, strConstructorString)

Dim objComCatalog
Dim objAppsCol
Dim objCompCol
Dim objComp
Dim ComponentFound

Set objComCatalog = CreateObject("COMAdmin.COMAdminCatalog")
Set objAppsCol = objComCatalog.GetCollection("Applications")
objAppsCol.Populate

Set objCompCol = objAppsCol.GetCollection("Components", strAppId)
objCompCol.Populate
For Each objComp In objCompCol

If UCase(objComp.Name) = UCase(strCompName) Then
SetConstructorString = True
objComp.Value("ConstructorString") = strConstructorString
objCompCol.SaveChanges
Exit For
End If
Next

End Function

Best Regards,

Laércio