[vtkusers] using vtksysProcess

Dean Inglis dean.inglis at sympatico.ca
Mon Mar 10 12:45:57 EDT 2008


I want to use vtksysProcess to execute a windows command line
utility, but am not sure how to do this.  Here is my code so far;
 
  vtkstd::string executable = "my_app.exe";
  vtksysProcess* process = vtksysProcess_New();
  vtkstd::vector<const char*> commandLine;
  commandLine.push_back(executable.c_str());
  commandLine.push_back("/arg1 /arg2");
  commandLine.push_back(0);
  vtksysProcess_SetCommand(process, &commandLine[0]);
  vtksysProcess_Execute(process);
 
  char* data;
  int length;
  int pipe =  vtksysProcess_WaitForData(process, &data, &length, NULL);
  vtksysProcess_Delete(process);
 
When I run this, my_app complains with:
 
Invalid argument/option - '/arg1 /arg2'
 
1) How do I pass args to my_app ? 
2) How do I retrieve the string(s) of information that my_app is supposed
to generate?
 
thanks,
Dean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080310/ca0255c7/attachment.htm>


More information about the vtkusers mailing list