COM+ automated registration of DLL's

  • 17 years ago

    Hi,


    I have found some code from microsoft which installs a new componet to a COM+ application:


      '  Open a session with the catalog.
       '  Instantiate a COMAdminCatalog object.
       Dim objCatalog As COMAdminCatalog
       Set objCatalog = CreateObject("COMAdmin.COMAdminCatalog")


       '  Create a new COM+ application.
       '  First get the "Applications" collection from the catalog.
       Dim objApplicationsColl As COMAdminCatalogCollection
       Set objApplicationsColl = objCatalog.GetCollection("Applications")


       '  Add a new item to this collection.
       Dim objZooApp As COMAdminCatalogObject
       Set objZooApp = objApplicationsColl.Add


       '  The "Applications" collection determines the available properties.
       '  Set the "Name" property of the new application item.
       objZooApp.Value("Name") = "MyHomeZoo"


       '  Set the "Description" property of the new application item.
       objZooApp.Value("Description") = "My pets at home"


       '  Save changes made to the "Applications" collection.
       objApplicationsColl.SaveChanges


       '  Install components into the application.
       '  Use the InstallComponent method on COMAdminCatalog.
       '  In this case, the last two parameters are passed as empty strings.
       objCatalog.InstallComponent("MyHomeZoo","MyZoo.DLL","","")


    However the InstallComponent will not work just comes up with a com+ internal error:


    The exact code I used was:
    objCatalog.InstallComponent "MyHomeZoo","c:\TestDll.dll","",""


    Has anyone got any ideas on this?


    Thanks


    Chris


Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Better train people and risk they leave – than do nothing and risk they stay.” - Anonymous