Hey Guys,
I wanted to create a blueprint which launches an an external program. Right now I’ve written the C++ code to create the blueprint, but I can’t seem to launch an external program. It’s not giving an error, it just does nothing. For test I’ve created a .txt file on my F drive and this is the code I’ve got so far.
Headerfile
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "LaunchExternalProgram.generated.h"
/**
*
*/
UCLASS()
class SERELLYN_LIBRARY_1_API ULaunchExternalProgram : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, meta = (DisplayName = "Launch External Program", CompactNodeTitle = "ExtProgram"), Category = "Core Functions")
static void LaunchExternalProgram();
};
CPPfile
#include "Serellyn_Library_1.h"
#include "LaunchExternalProgram.h"
void ULaunchExternalProgram::LaunchExternalProgram() {
FPlatformProcess::CreateProc(TEXT("F:\\test.txt"), nullptr, true, false, false, nullptr, 0, nullptr, nullptr);
}
I hope someone can show me what i’m doing wrong.
Thank you!