1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to invoke C++ from Javascript

Discussion in 'JavaScript and AJAX' started by sharmila, Nov 14, 2006.

  1. sharmila

    sharmila New Member

    Joined:
    Mar 24, 2006
    Messages:
    75
    Likes Received:
    1
    Trophy Points:
    0
    Hi,
    Can anyone explain me how to invoke a c++ function from javascript?

    Regards,
    sharmila.
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    Here 's how to do that using ActiveX object.

    Code:
    function executeCommands(inputparms)
     {
         // Instantiate the Shell object
         var oShell = new ActiveXObject("Shell.Application");
     
         var commandtoRun = "C:\\Programs\\YourCProgram.exe";
         // Invoke the execute method.  
         oShell.ShellExecute(commandtoRun, commandParms, "", "open", "1");
     }
     

Share This Page