Hello I’m trying to start a process, and get it’s process id. However when I run the code below the editor crashes. I’m guessing it’s because the process hasn’t had enough time to start up and give me the ID.
Does anyone know a way to retrieve the process id when using CreateProc()?
FString UMyTestClass::MyTestClass(FString MyTextVariable)
{
const TCHAR* wavLink = *MyTextVariable;
uint32* OutProcessID = 0;
FProcHandle RecordAudioProcess = FPlatformProcess::CreateProc(TEXT("MrProgram.exe"), wavLink, true, false, false, OutProcessID, 0, nullptr, nullptr);
return TCHAR_TO_UTF8(OutProcessID);
}