Download

UObject::SaveConfig() question

Hey there,

i am having troubles saving in a custom .ini file via SaveConfig()

The problem i have is, that i cant use


 FPath::GameSavedDir()

and then route to the appropriate file based from this.

when i say


...->SaveConfig(16384Ui64, L"absolute Path") 

it is working
but when i try to make a stringPath consist of “GameSavedDir+route to my ini-file”

i cant use it like this:


SaveConfig(16384Ui64, myString)   or    SaveConfig(16384Ui64, TEXT(myString))     or SaveConfig(16384Ui64, TEXT("%s", myString))


TEXT macro do not like any variables, and the first option is complaining the “L”-word is undefined. How am i able to convert my string to TChar* ?

Thanks for any help

You need to use the * operator to convert an FString to a TCHAR pointer. This should work:


SaveConfig(..., *myString)

Omg, thank you so much.

To miss something that simple…