Solved

DCOM - Client registration

Posted on 2001-06-19
14
803 Views
Last Modified: 2007-12-19
2 Small Questions:

1)Re client reference to DCOM component

Should the client app be referencing the local AppName.TLB file, or should it be directly referencing the AppName.EXE located on the server?


2)Re CLIREG32.exe

I'm going to have a number of exe's on one client PC referencing the same Server ActiveX
component. Is there a free utility available for managing client registrations, eg I'm wanting to temporarily
de-register an exe so that I can test locally on my development PC? Also will need to do multiple registrations
at setup.

I'm looking for a windows interface to the Dos styled CLIREG32.exe
0
Comment
Question by:rhubarbtwo
  • 8
  • 4
  • 2
14 Comments
 
LVL 5

Expert Comment

by:AndrewDev
Comment Utility
1) The TLB file. The TLB file points to the correct server.

2) We wrote our own utility in VB to copy, install and register the appropriate componants at their correct destinations. However it is not possible to do the DCOMCNFG programatically, so if a server is rebuilt and shipped we register it with our utility, which is database driven, but gave to do the DCOMCNFG manually as I mentioned in your previous question.

Hope this helps
Andrew
0
 

Author Comment

by:rhubarbtwo
Comment Utility
AndrewDev, Can I ask a couple of questions about your installations please:
 
1)Do you copy the TLB and VBR to the client's Windows\System dir?

2)Do you run your client registration utility at each client PC or can you do it from the server?

0
 
LVL 5

Expert Comment

by:AndrewDev
Comment Utility
1)I think we copy both, the VBR contains the registry entries, the TLB defines the interface.

2) We run it on each client PC. I am running on NT. I have created a policy with a specific name for deployment which runs the deployment utility as the shell so all I need to do is change the autologin to this user and restart the PC.
I use Remotely Anywhere for doing this (free trial available from www.RemotelyAnywhere.com)

I would offer you my utility but it is very tied in with our environment here. You would be better writing your own.

Hope this helps
Andrew
0
 

Author Comment

by:rhubarbtwo
Comment Utility
Andrew, thanks that's interesting, I don't fully understand what you say about policies and deployment etc but I will read up on Remotely Anywhere.

What's happened is that my app was running the activeX component on the server ok, but then I wanted to run it locally to do some testing. so I unregistered the activeX component at the client and after a reboot I was running the activeX component locally on my dev PC. Now I want to reregister and run it on the server again.

I've re-run CliReg.exe with its options, but when I try to reference the TLB file in VB by browsing to the original TLB file in Windows\System (component has not been recompiled) then it does not show in the list. There are however 3 other obsolete listings for the same ComponentName.EXE, but none for the TLB.

Although from what you say it should not be necessary, I subsequently re-ran Dcomcnfg on the server an adjusted 'interactive user' as previously suggested.

I shall try a reboot!!
0
 

Author Comment

by:rhubarbtwo
Comment Utility
I've got one project which appears to run the activeX component on the Server and the other still causes an error.

Does the object have to be instantiated using the 'CreateObject' method?

For the project which works the path to the referenced component is shown to be the path to the exe on the server and not hte path to the local TLB file, and in this project I have used the 'CreateObject' method.
0
 
LVL 5

Accepted Solution

by:
AndrewDev earned 50 total points
Comment Utility
The one using Create Object is late binding so not specifically referenced.

I suspect what has happened is the other one is specifically referencing the wrong one.

I can't remember whether I have said this before but if you run an Active X Server on a PC it registers the exe on that machine. So if the TLB was registered before it will have been replaced when you ran the server to debug it.

To avoid having the previous versions in DCOMCNFG unregister the old versions before registering the new. Its one of the optional switches

Need to dash and put my daughter to bed. I'll try and catch up later

Regards
Andrew
0
 

Author Comment

by:rhubarbtwo
Comment Utility
My dev machine is Win98 and even though i've installed DCOM DCOMCNFG.exe is not installed, I assume this is because I'm not running NT.

The old component versions are listed in the VB Project|References dialog and I don't seem to be able to get rid of them, but I think the list in Dcomcnfg on the Server has only one entry.

So should unregistering using CliReg32.exe sort things out?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:rhubarbtwo
Comment Utility
You say "if you run an Active X Server on a PC it registers the exe on that machine" I have run:

<Path>\activeXAppName.exe /regserver -u

I've then run CLIREG32.exe to register then client

I've then checked in the registry and there are still entries under eg:

HKEY_CLASSES_ROOT\CLSID\{179FFA51-50F4-11D5-8415-00001CD86C8B}\LocalServer32

Entry is eg:

(Default)
0
 

Author Comment

by:rhubarbtwo
Comment Utility
I've rebooted and in the vb project, vb still won't reference the TLB file, but I have referenced the exe at the server address. When run it runs the exe locally even though in Dcomcnfg on the server it is ticked to 'Run application on this computer'.

Is there something wrong with my unregister process?
0
 

Author Comment

by:rhubarbtwo
Comment Utility
It's running on the server now, not sure what solved it. The vb ref is to \\server\componentName.exe not to c:\<path>\componentName.TLB, is that OK? What if the component is recompiled?

Also your comments on why I can't remove listings from the vb References dialog and from HKEY_CLASSES_ROOT\CLSID would be helpful.

Thanks
0
 
LVL 5

Expert Comment

by:AndrewDev
Comment Utility
While browsing for something else I found this graphical interface to RegSvr32 which might be of use. Including for the general usefulness value rather than as an answer to your question

http://www.freevbcode.com/ShowCode.Asp?ID=1422

I am passing a link to this question to a coleague who knows more than I do. Hopefully he will join in with specific answers to some of your more detailed questions.

Regards
Andrew
0
 
LVL 5

Expert Comment

by:GeoffKell
Comment Utility
Hi,
Andrew asked me to have a read through this and comment as appropriate. There is a lot to take in but here are a couple of quick pointers :-

>> <Path>\activeXAppName.exe /regserver -u

I assume you did this toi unregister the server. You should have done

<Path>\activeXAppName.exe /unregserver

The -u is used in RegSvr32 not CliReg32

Also, my prefered mechanism for registering/unregistering DLL's & OCS's is using

http://www.mvps.org/ccrp/cooltools/ocxdllreg.zip

Download the zip and extract the .reg file. Double click it and say Yes to everything. This sets the registry so that you get a Register and Unregister item on the right click menu under Windows Explorer when a DLL or OCX is highlighted. This makes the registering/unregistering so much easier.

Regards
GK
0
 
LVL 5

Expert Comment

by:GeoffKell
Comment Utility
Also, don't forget that building the EXE will cause it to become registered

Regards
GK
0
 

Author Comment

by:rhubarbtwo
Comment Utility

Geoff\Andrew,

There is a -u option mentioned in the CliReg32 help dialog to uninstall a VBR file, does that not remove refs from the reg? Maybe I didn't try unregister on the client. Just tried unregister, but class id entry in reg still remains.

I found the reg tool you mentioned at the following modified link - it sounds a lot easier with this tool for dlls/ocxs  http://www.mvps.org/ccrp/download/cooltools/ocxdllreg.zip

Yes I realised since my last post that there are 2 sets of reg/unreg processes, regserver and unregserver for DCOM, and RegSvr32 and RegSvr32 -u for dll's and oxc's - all very confusing.

I've resorted to taking a backup of my registry and then deleting class id's for unwanted versions of my component where there is a LocalServer key; the listings still don't disappear from Vb.

Thanks both of you for your help on this.


0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

16 Experts available now in Live!

Get 1:1 Help Now