Hi guys, I have a little problem with my C# code and I need some help. My program essentially runs a series of external executables using threads that run processes. I have no problem running threads and processes but my program will miss out vital code if I don't simply put a MessageBox at that specific point of code.
Question
limok
Hi guys, I have a little problem with my C# code and I need some help. My program essentially runs a series of external executables using threads that run processes. I have no problem running threads and processes but my program will miss out vital code if I don't simply put a MessageBox at that specific point of code.
Check this;
public void callWav()
{
if (isVideo == true && isAudio == false) { sendH264ToMP4(exFileVideo); }
else if (isAudio == true || isVideoAndAudio == true)
{
//code
if (ac3Exists == true)
{
threadCon(new MyAudioMethod(createAudio), "Converting AC3 to WAV", parameter, "\\valdec.exe");
}
MessageBox.Show("w");
}
}
public void threadCon(MyAudioMethod methodToRun, string name, string _parameter, string _path)
{
threadConversion = new Thread(delegate() { methodToRun(_parameter, _path); });
threadConversion.Name = name;
threadConversion.IsBackground = true;
threadConversion.Start();
}
public void createAudio(string _parameter, string _path)
{
string path = (executableDirectory + _path);
runProcess(path, _parameter);
runExecutable.WaitForExit();
MessageBox.Show("If I don't put this here the compiler will skip the WaitForForExit(); and run the MessageBox("w");
processRan = false;
}
Link to comment
Share on other sites
0 answers to this question
Recommended Posts