Solved

DCOMError :Interface not supported

Posted on 2000-05-16
10
1,957 Views
Last Modified: 2008-03-17
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?
0
Comment
Question by:mem100
  • 4
  • 3
  • 3
10 Comments
 
LVL 3

Expert Comment

by:KE
Comment Utility
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.

Regards
0
 
LVL 1

Expert Comment

by:xsoft
Comment Utility
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.
0
 

Author Comment

by:mem100
Comment Utility
xsoft

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.
0
 
LVL 1

Expert Comment

by:xsoft
Comment Utility
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.

HTH,

Thomas
0
 

Author Comment

by:mem100
Comment Utility
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
HKCR\appid\{Clsid}
HKCR\Appid\appname.exe

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"
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 3

Expert Comment

by:KE
Comment Utility
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.

Regards
0
 

Author Comment

by:mem100
Comment Utility
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.
0
 
LVL 1

Accepted Solution

by:
xsoft earned 100 total points
Comment Utility
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.

HTH,

Thomas
0
 
LVL 3

Expert Comment

by:KE
Comment Utility
Clients:
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).

Regards
0
 

Author Comment

by:mem100
Comment Utility
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.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now