The process of the node from the program in c ++ starts

char fname[] = "D:/node.exe"; char cfname[] = "D:/node"; STARTUPINFO cif; ZeroMemory(&cif, sizeof(STARTUPINFO)); PROCESS_INFORMATION pi; CreateProcessA(NULL, fname, NULL, NULL, FALSE, CREATE_NEW_PROCESS_GROUP, NULL, cfname, &cif, &pi); 

To run the script for execution, you can simply replace "D: /node.exe" with "D: /node.exe run", but in this case the file with the code will have to be written to the hard disk and it can be read by an outsider. You can still execute the code by inputting it into the node's console, that's just how to make this input programmatically?

I tried this example http://www.sources.ru/cpp/using_anonymous_pipes.shtml , everything works with a regular console, but does not want a node window ...

  • one
    Is the -e option no longer working? node -e 'console.log("what?")' - Alexey Ten
  • @AlexeyTen, this will work, but I would like to know why the node does not want to receive messages from the replaced StdIn - Kopkan Sep.
  • There certainly is isTTY checking - Alexey Ten
  • You can also use https://nodejs.org/api/repl.html - Alexey Ten

0