Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error using ActiveX EXE on server 1

Status
Not open for further replies.

timmah13

Programmer
Feb 25, 2003
12
0
0
US
I created an ActiveX EXE to replace a class that may need to be changed often. Instead of having to recompile the application (8 MB), I wanted to be able to simply and quickly replace the ActiveX EXE (80 KB) via an internet connection. The application is placed on the server with multiple clients accessing it through a shortcut.

As I understand the difference between ActiveX DLLs and ActiveX EXEs is that the DLLs must reside and be registered on each client whereas an EXE can reside solely on the server. Is that essentially correct? Does the ActiveX EXE need to be registered as well? If so, where and how? Does it make a difference whether the component is early or late bound (I've tried both)? My application works fine in testing with a compiled ActiveX EXE located in the same directory, but I get errors when running the client portion. They are: "Class not registered on local machine" or "ActiveX component can't create object" depending on what I try. I've been unable to find any solutions on the internet as yet. Any help is appreciated.
 
You'll have to dig into using DCOMCNFG.exe to register the exe in the server as well as on the client machine.


Greetings,
Rick
 
DLLs are in-process, EXEs run in a separate process. To register an ActiveX EXE, all you have to do is run it once. (There is a utility that registers and unregisters EXE files, but I don't remember the name off hand.) I would try locating the exe file on the server, and running it from the client machine.

Early and late binding have nothing to do with this issue that I know of. Rather, they have to do with which COM interfaces are used to create a given class instance. Early binding means that you compile what type of class you are using, late means that you figure that out at runtime.

The reason it works fine with the compiled activex exe in the same directory is probably because another way to register one is to compile it, so you probably are testing it on the development machine and therefore have registered it de facto.

Good Luck!

Bob

Bob
 
Registering the COM server on the client by running it will not be sufficient; you have to let the client know at which location to instantiate the server object (default will be the local machine).

You'll also need to configure the server side to grant access from the client machines.

Both can be acomplished with DCOMCNFG....

Greetings,
Rick
 
LazyMe (Rick),

Thanks for your original reply regarding using DCOMCNFG. After getting that all important tip, I did some more research and eventually got my ActiveX EXE to work on the remote server.
 
Hi Rick

I am having the same problem, could you tell me how you solved it?

Thanks


Nestor
 
No need to use DCOMCNFG to register an AxtiveX.exe-file.

Just run the executable from a command prompt or from <start> <RUN> with /register after it.

So to register 'myapp.exe'; you run 'myapp.exe /register'
(don't forget to add the full path)

It will then register itself automatically.
 
Nope, true. In fact; you can't even register anything with DCOMCNFG.

But as said; registering the server is not suficient. Acces rights must be arranged and the location of the server must be set (so the client knows on which machine to instantiate the server). These are the things that can be done by DCOMCNFG.

Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top