当前位置:网站首页>Start other independent programs through fmmonitoredprocess in unreal

Start other independent programs through fmmonitoredprocess in unreal

2022-07-23 15:12:00 Taoxi Xiaosheng

We are Unreal When writing some tool code in the project , It is likely to call some third-party programs , This requirement can be used FMonitoredProcess solve .

Usage mode

	
FString FullExePath = exe The path of 
FString ExeParam =  To pass on to exe Parameters of 
TSharedptr<FMonitoredProcess> NewProcess= MakeShareable(new FMonitoredProcess(FullExePath , ExeParam , true));
NewProcess->OnOutput().BindLambda([&](const FString& Text) {
  The output of third-party programs will be captured here 
if(Text == TEXT("Step1"))
{
     The first step is done 
}
		});

// Start the program 
	NewProcess->Launch();

Third party programs can pass Output To trigger Unreal Some behaviors of tools .

原网站

版权声明
本文为[Taoxi Xiaosheng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207231013137677.html