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

Posted on 2009-12-21
Last Modified: 2012-08-14
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?
Question by:nvdbijl
    LVL 41

    Accepted Solution

    You may try
    RegSvr32 ImageViewer2.ocx
    from DOS/cmd window

    RUN RegSvr32 ImageViewer2.ocx
    from FoxPro

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

    More stuff about programmatic registration is here:
    LVL 14

    Expert Comment

    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.
    LVL 29

    Expert Comment

    by:Olaf Doschke
    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.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Join & Write a Comment

    Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: (http://msd…
    It can often be challenging to stay relevant in the rapidly evolving world of technology. This can make recruiting talent difficult for companies of all sizes.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    728 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

    24 Experts available now in Live!

    Get 1:1 Help Now