Search code examples
vb.netvb6com+

How to call a com+ component?


I'm making some archeology, dealing with COM+

I managed to enlist a simple COM dll as a COM+ component, so far so good.

So I've got this 'foobar' com+ component, with it's interface, and the method I'd like to call.

My question is then rally simple: how am I supposed to make a call to this component?

Any .NET or VB6 answer is accepted (I have to check the component is OK, don't care about the client)

Thanks

Edit (06/03/09): Well, I'm confused. so as to work properly, my COM+ component needs it's dll to be registered. Why not? But then, how to be sure I'm making a COM+ call, and not a COM one?


Solution

  • If all you are wanting is to check the component responds when called then use a quick VBScript rather than building something in VB6/VB.NET.

     Dim o : Set o = CreateObject("Lib.Class")
     o.YourMethod "someParam"
    

    Watch your COM+ app in Component Services to see if the class requested spins up.