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,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice