Board index » delphi » Registering DCOM Server .tlb on client

Registering DCOM Server .tlb on client

I am trying to find the best way to distribute our newly DCOM enabled app,
and am trying to get my head around the best way to register the server on
the client machines. The Server is written in D5, the client in VB6.

When I include the servers .tlb file on the client machine and register it
using tregsvr, there is no entry in dcomcnfg. Is this normal, or have I done
something wrong? If it is normal, how do I then tell the clients where the
server resides? Do I need to initialize the HKEY_CLASSES_ROOT\AppID registry
key in the clients setup program or is there another way?

The VB boys tell me that using CreateObject("Server.Class", "Machine Name")
uses late binding and makes life quite hard when using events, so this is
not an option I am considering at the moment.

--
Cheers,
David Clegg
dcl...@ebetonline.com

 

Re:Registering DCOM Server .tlb on client


Quote
"David Clegg" <dcl...@ebetonline.com> wrote in message

news:3adbb4cd_2@dnews...

Quote
> I am trying to find the best way to distribute our newly DCOM enabled app,
> and am trying to get my head around the best way to register the server on
> the client machines. The Server is written in D5, the client in VB6.

> When I include the servers .tlb file on the client machine and register it
> using tregsvr, there is no entry in dcomcnfg. Is this normal, or have I
done
> something wrong? If it is normal, how do I then tell the clients where the
> server resides? Do I need to initialize the HKEY_CLASSES_ROOT\AppID
registry
> key in the clients setup program or is there another way?

TLBs cannot be used to specify DCOM information. You'll need to manipulate
the CLSID and AppID information in the registry for that. If you had your
servers under MTS, the MTS-generated client-install does all of this for
you.

Quote
> The VB boys tell me that using CreateObject("Server.Class", "Machine
Name")
> uses late binding and makes life quite hard when using events, so this is
> not an option I am considering at the moment.

CreateObject does not necessarily use late-binding and in no way makes life
hard when using events. A declaration like this is not latebinding:

private withevents Foo as IFoo

sub TestFoo
    set Foo = CreateObject ("FooServer.Foo", "MachineName")
end

This is not latebinding and there is nothing tricky with events. Just the
normal VB stuff.

--
have fun

Binh Ly
www.techvanguards.com

Re:Registering DCOM Server .tlb on client


Thanks Binh. Once again it shows that our VB boys don't know what they are
talking about <g>.

Cheers,
David Clegg
dcl...@ebetonline.com

Quote
"Binh Ly" <b...@castle.net> wrote in message news:3adbbeda$1_1@dnews...
> CreateObject does not necessarily use late-binding and in no way makes
life
> hard when using events. A declaration like this is not latebinding:

> private withevents Foo as IFoo

> sub TestFoo
>     set Foo = CreateObject ("FooServer.Foo", "MachineName")
> end

> This is not latebinding and there is nothing tricky with events. Just the
> normal VB stuff.

> --
> have fun

> Binh Ly
> www.techvanguards.com

Re:Registering DCOM Server .tlb on client


HI Binh/David,

    TLB files can be registered by install shield, so it is installed along
with the application, or I use regtlib.exe.
I've never had problems with just registering a tlb file to register the
interfaces and class(es) for my objects and servers.
With using a DCOM server you can easily create the object from the client
using, the CoClass or CreateRemoteCOMObject()

vMyClass := CoMyClass.CreateRemote('MyServer');
or
CreateRemoteComObject('MyServer', CLSID_MyClass, vMyClass);

The only time I've ever had to jump into the registry is when interface
referencing is {*word*81}ing up and it's due to registry referencing or {*word*81}ed
up
the settings and its refering to the wrong library files, etc..

Also, David.... when should you ever listen to VB boys :)

Laters...

Chris.

Quote
"Binh Ly" <b...@castle.net> wrote in message news:3adbbeda$1_1@dnews...
> "David Clegg" <dcl...@ebetonline.com> wrote in message
> news:3adbb4cd_2@dnews...
> > I am trying to find the best way to distribute our newly DCOM enabled
app,
> > and am trying to get my head around the best way to register the server
on
> > the client machines. The Server is written in D5, the client in VB6.

> > When I include the servers .tlb file on the client machine and register
it
> > using tregsvr, there is no entry in dcomcnfg. Is this normal, or have I
> done
> > something wrong? If it is normal, how do I then tell the clients where
the
> > server resides? Do I need to initialize the HKEY_CLASSES_ROOT\AppID
> registry
> > key in the clients setup program or is there another way?

> TLBs cannot be used to specify DCOM information. You'll need to manipulate
> the CLSID and AppID information in the registry for that. If you had your
> servers under MTS, the MTS-generated client-install does all of this for
> you.

> > The VB boys tell me that using CreateObject("Server.Class", "Machine
> Name")
> > uses late binding and makes life quite hard when using events, so this
is
> > not an option I am considering at the moment.

> CreateObject does not necessarily use late-binding and in no way makes
life
> hard when using events. A declaration like this is not latebinding:

> private withevents Foo as IFoo

> sub TestFoo
>     set Foo = CreateObject ("FooServer.Foo", "MachineName")
> end

> This is not latebinding and there is nothing tricky with events. Just the
> normal VB stuff.

> --
> have fun

> Binh Ly
> www.techvanguards.com

Other Threads