How to invoke C++ from Javascript

Contributor
14Nov2006,09:56   #1
sharmila's Avatar
Hi,
Can anyone explain me how to invoke a c++ function from javascript?

Regards,
sharmila.
Team Leader
14Nov2006,10:19   #2
pradeep's Avatar
Here 's how to do that using ActiveX object.

Code: JavaScript
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");
 }