PDA

Click to See Complete Forum and Search --> : DCOM & Early binding


Dorothy
Jan 18th, 2002, 12:19 AM
How can I early bind a Acx EXE in DCOM?

I dont wish to use

Set t=CreateObject("PClass")

I wish to use it as:

Dim a as New PClass
a.method1()...

Help me out?

Lethal
Jan 18th, 2002, 09:34 PM
All you have to do is set a reference to the components type library. After you do this, you can early bind your object variable to your desired interface. Also, it is not the CreateObject function that determines whether or not you are using, early binding, late binding, dispatch binding, etc., it is determined by your declarative statement: For example:


' This is an example of using late binding
Dim objServer As Object

' This is an example of early binding
Dim objServer As MyServerClass


Hence, in the first example, vb is not able to determine the type of object that you want to use, where in the second example, you are explicity saying that you want to bind your object variable to the MyServerClass object. Hope this makes sense to you.. ;)