Link to home
Start Free TrialLog in
Avatar of rhubarbtwo
rhubarbtwo

asked on

Manually setting up DCOM Client/Server app

My question is very similar to the one at https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20135365

I've read the article at http://support.microsoft.com/support/kb/articles/Q266/7/17.ASP which describes the procedure using Package and Deployment Wizard, I'm wanting to test the app without using P&D wizard.

I've..

1)created an activeX exe and under properties>Component I have selected 'Remote Server Files' to create the vbr and tlb files when compiled. However because at present the app has a form I have not been able to select 'Unattended execution' in the General tab (The form could be removed if this is a problem).

2)placed the active exe on a server and run <path>\<activeX exe name> to register it.

3)had a look at Dcomcnfg but left permissions set at default.

4)In the client app I've referenced the activeX exe located on the server.

5)run <Path>\CLIREG32 <path>\<activeX>.VBR and in the dialog's address box entered the full network path of the activeX exe on the server.

When I run the client app in the IDE and step through the code, the CreateObject method worked but since there is a form in the activeX exe the app shows as running on the win98 workstation and does not show in the NT task manager.

Now when run the CreateObject method creates an error which says 'The remote server machine does not exist or is unavailable'.

Any clues?
Avatar of rhubarbtwo
rhubarbtwo

ASKER

Forgot to say I'm using the activeX exe to open an ado connection on the server to a Db located in an un-shared drive. Then another call will pass a recordset using that connection. Is that sensible? For security I don't want the user to see the data files and their location, but the activeX exe will acquire that info somehow.
JUST MAKE SURE REMOTE MACHINE YOU MENTIONED WHILE
INSTALLING PACKAGE EXISTS OR ACCESSIBLE>
MAKE SURE THE CLSIDS AT THE REMOTE MACHINE AND
CLIENT MACHINE ARE SAME>Tht is it
martin
I've followed Craig Boland's notes which come with his project at Planet Source Code http://www.planetsourcecode.com/xq/ASP/txtCodeId.10751/lngWId.1/qx/vb/scripts/ShowCode.htm

I get the feeling I have a problem at the Client end, maybe I have not run CliReg32.exe correctly.
Got it to work now by using the Package and Deployment Wizard for the Client installation. So could do with some help to setup the client manually ie without using P&D wizard, some help with the usage of CliReg32.exe would be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of AndrewDev
AndrewDev

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I had the activeX exe running ok on the server, then I removed two forms and recompiled. I re-referenced the activeX component in my client project, recompiled, and now the component runs on the client not the Server. I've checked the component is still registered in Dconcnfg to run on the server.

Also even without any forms in the activeX component, the option of Unattended Execution is always greyed out (there is a standard module included in the project).
I've reregistered the client, now when I call CreateObject I get an Automation error
After recreating a server you need to reregister and run DCOMCNFG again.

In DCOMCNFG you don't have to set everything up from scrath, what I do is go to the identity tab, change it to the interactive user hit Apply, then change it back to the launching user and hit Apply.

If you are using the 'this user' option the same applies, just change it to one of the others and back again. It will then work.

Remember to make sure your new server is registered before running DCOMCNFG. Unless an exposed interface has changed you shouldn't need to run CLIREG32 again.

Hope this helps
Andrew

So I have to run Regsvr32 for each recompile of the activeX exe even though its name is the same?

I notice the client app references the TLB file. When the activeX exe is recompiled this will be updated I presume. So should the client be referencing a local copy of the TLB file or a central one on the server? If a local one, then does that need updating?
Yes - the problem is it is not the name but the class ids that are registered. So if you recompile, unless you force the class ids to be the same you have to run Regsrv32 again.

As long as you haven't changed the client interface you shouldn't  need to run clireg32 again. However if in doubt it won't do any harm.
AndrewDev : 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