• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1439
  • Last Modified:

How can I register the ActiveX control ImageViewer2.ocx with VFP code

To use the AxtiveX control of Image Viewer CP Pro, the ocx needs to be registered. How can I do this by running some code?
0
nvdbijl
Asked:
nvdbijl
1 Solution
 
pcelbaCommented:
You may try
RegSvr32 ImageViewer2.ocx
from DOS/cmd window

or
RUN RegSvr32 ImageViewer2.ocx
from FoxPro

or you may try following code:
DECLARE LONG DllRegisterServer IN ImageViewer2.ocx
IF DllRegisterServer() = 0
* OK
ELSE
* Not OK
ENDIF


More stuff about programmatic registration is here:
http://fox.wikis.com/wc.dll?Wiki~ComRegUnreg
0
 
tusharkanvindeCommented:
It is better to register during installation rather than during running. Registering requires admin rights which will force your software to be run as admin.
0
 
Olaf DoschkeSoftware DeveloperCommented:
second tushar. A second best solution is creating a setup that enforces the program to run directly after the installation (but typically the user is asked, if he wants to do so and can deny that), because then that first run is also done as admin.

If you don't have any setup and simply deploy your app and runtimes without any registration, then you should consider creating an installer.

Bye, Olaf.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now