Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DCOM - Client registration

Posted on 2001-06-19
14
Medium Priority
?
852 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
ID: 6206890
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
ID: 6206965
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
ID: 6207045
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:rhubarbtwo
ID: 6207194
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
ID: 6207336
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 200 total points
ID: 6207953
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
ID: 6209485
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
 

Author Comment

by:rhubarbtwo
ID: 6209648
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
ID: 6209698
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
ID: 6209788
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
ID: 6210074
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
ID: 6210111
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
ID: 6210383
Also, don't forget that building the EXE will cause it to become registered

Regards
GK
0
 

Author Comment

by:rhubarbtwo
ID: 6210471

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

886 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