argument to nativeprocess failed
I need to pass the "" to the mm.exe that run with nativeprocess. When I pass "In From MIDI Yoke: 1" even using \" to the nativeprocess, it won't launch the application properly and caused it to crash. What wrong this the code?
private function soundbank():void {
var argMidi5:Vector.<String> = new Vector.<String>;
var file:File = File.applicationDirectory.resolvePath("java/mm.exe");
argMidi5.push('-g 0 -m winmidi -o midi.winmidi.device="In From MIDI Yoke: 1"');
npSB = new NativeProcess开发者_StackOverflowStartupInfo();
npSB.workingDirectory = File.applicationDirectory;
direct = String(File.applicationDirectory);
npSB.executable = file;
npSB.arguments = argMidi5;
npSBOut = new NativeProcess();
npSBOut.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onSoundbank);
npSBOut.start(npSB);
trace(argMidi5);
}
try this:
argMidi5.push("-g");
argMidi5.push("0");
argMidi5.push("-m");
argMidi5.push("winmidi");
argMidi5.push("-o");
argMidi5.push("midi.winmidi.device=\"In From MIDI Yoke: 1\"");
Arguments are passed as individual strings in a vector, not a single string.
精彩评论