DCOMError :Interface not supported

I wrote a DCOM server app using D4 auotmation object wizard. I have registerd the app on a NT4 Server(sp 6) and used DCOmcnfg togive everyone the right to access and launch the app, and configured the identity of the app as the administrator account.

When I run a client app to access the server app from NT4 workst I get "Interface not supported" error from CreateRemoteComObject fcn in client app.

To debug I used CogetclassObject to get Classfactory from Server app,this worked fine. Then tried calling Createinstance fcn of classfactory but that returned error "Interface not registered". Checked HK_Classes _Root of registry on NT Server  and found entries for my app so it is registered.(Also it shows up in DComcnfg)

If i register server interface on workst then run client app it works fine.

Why doesn't the client app work if server interface not registered on workst?
Who is Participating?
xsoftConnect With a Mentor Commented:
Just call tregsvr without parameters in a dos box. The you will see the different options with a short explanation. If you call tregsvr myserver.tlb it should normally succeed if the *.tlb is on this machine and you you call tregsvr from the same directory as where your TLB resides or sou supply the full path of your TLB to tregsvr.
If you leave the TLB on the client machine you would not need to have the server exe on that machine.

If you want to find out if the TLB-info is used from the server or the *.tlb look in the registry:
\HKEY_CLASSES_ROOT\TypeLib\{your TLB-ID}\1.0\0\win32

I suppose you forgot to delete this key and thats why your client did work.


The client app. don't know about the interfaces that your server provides - as they are not registered anywhere. You have to register the type library on every client that will use the server remotely. The workstation should also be able to accesss the .tlb file, so you have to distribute this along with the client.

You can use tregsrv as part of the client installation - If you don't like tregsrv, the source is available on your Delphi CD.

You can copy the server.exe on the client machine and run it once.
After that it will be registered on the client machine and you can delete the server exe.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

mem100Author Commented:

I have done that and I know it works, but my understanding(correct me if I am wrong) of the process is that the COM libraries on the client machine will contact( using the machine name arg of the CreateremoteComobject fcn) the server machine and make a request to create the object and return an interface. As such the interface and  object only has to be reqistered on the server and not the client.

I have  another problem. My server makes calls to some LAN manager Net() fcns in the  Netapi32.dll so I can't run the server on my 95/98 clients to register the interface.
The Create and CreateRemote functions from the CoClass of your Com-Server are declared in the Typelibrary of the server, therefore the typelibrary has to be registered on the clientmachine also.

If you want to run the server on the client machine in order to get it registered, call it like this:
myserver.exe /REGSERVER
This will start your server, register it and immidiately terminate it after it was registered before calling any specific functions of your server.
This should work on your W95/98 clients too.


mem100Author Commented:
I understand about registering the typelib on the client. I tried to manually place the entries in the registry to register the typelib
did the foll.

in HKCR\servername.objectname\clsid key place
string value that is CLSID of object

in HKCR\CLSID\{CLSID of object}
 Added key typelib and then added string value  IID of typelib in the key

Added key ProgID and then added string value

servername.objectname in the key

but this didn't work. I even tried placing entries under

but that didn't work. ideally I would prefer to edit the registry that to run  the server on the client to register it.

I tried registering the server on the client like you said but because it is linked to the netapi32.dll through an external declaration it will try to load the dll even if no fcn are called.

I got the foll an errror on 95/98 machines:
"servername" is linked to missing export netapi32.dll"
Distribute your client, with the myserver.tlb file, and use tregsrv to register the tlb file. I think the reason that your reg. entries are not working, is that you don't have any reference to the type library. As you don't install the server on the client machine, you won't have the type library available for your app.
The type library itself, is not stored in the registry - there's only a reference to either an .exe or .tlb file.

mem100Author Commented:
how do I register the *.tlb with tregsvr, doesn't tregsvr only work with *.exe and *.dll?

Can someone explain this:

I register the server on a client using the tregsvr
and ran the client, got no errors

Then I used regedt32 on the client and manually deleted all the registry entries in HKCR that tregsvr place for my server app. Ran the client afterwards and still got no errors. Rebooted the machine, ran the client again and still got no errors.Client works fine even though there are no registry entries for the server interface.

According to my understanding  only need to register the server interface on the client if using early(vtable) binding, but the Delphi automation object used create the server uses Dispatch interface which uses late binding so I shouldn't have to register the server interface on the client.
I included the server's typelib in the "uses" of my client project so the client knows the IID of the server interface and the CLSID of the server object.

What I describe about seems to confirm that the server interface doesn't have to be registered unless I missed some registery entries.

why is it the client won't work normally(server interface not registered) but will work if the interface is registered and then manually deleted.
Late binding is ONLY used with script based client's, and VTable's is ONLY used with compiled clients.
So you are right about that you need to register the TLB on the client (assuming that your client is made with Delphi).

mem100Author Commented:
Exactly what I was looking for. Suspected that I was missing a registry entry but couldn't find what it was from all the documentation I had.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.