RUNNING A C PROG FROM VB and registration of active x

Posted on 2006-03-27
Last Modified: 2010-04-17
                      CAN U PLS HELP MEEEE....
        i want 2 know 1)how to run a c program from VB and
                             2)how 2 register my own activex control in windows registry?
Question by:mithunda50
    LVL 6

    Accepted Solution

    1)  You can run any executable (including one originally written in C) from VB6 with the command;
            Shell "C:\App.exe"

    Substitute C:\App.exe with the path and filename you want

    2) You can register an activex control with the command

            RegSvr32 "C:\ActiveX.ocx"

    Substitute C:\ActiveX.ocx with the path and filename of your activex control.  To unregister, use the same command but put /U in the command line.
    LVL 2

    Assisted Solution

    You can run any executable by accessing the shell (command prompt) with the code:
    where strPathAndFileName is something like "c:\temp\myExe.exe"

    Of course, you would need to have the c program compiled into an executable before hand.  There is no way to run c code without first compiling.

    To register a control, open the 'Run' window (click start-> run), and type the following:
    regsvr32 "C:\PathToConrtol\myActiveXControl.ocx"

    Just typing regsvr32 without any options will bring up a screen showing basic use of regsvr32.
    There is also more explanation of regsvr32 here:

    Hope this helps.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    INTRODUCTION We all know how to code. But at times you simply want to insert a common code block into your existing code and amend it as per your requirements. This tool not only saves you time but also saves you the pain of typing it all out aga…
    RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    755 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

    23 Experts available now in Live!

    Get 1:1 Help Now