Call Blueprint function from C++ and get the return value

I feel kind of stupid now.



Value = StrReturnValue->GetPropertyValue_InContainer(FuncParam.GetStructMemory());


So at the end of UObject->ProcessEvent(UFunction, void*), Epic performs an FMemory::Memcpy, and copies all the out param values to the param memory address passed in, which in my case was FuncParam.GetStructMemory();



// Destroy local variables except function parameters.!! see also UObject::CallFunctionByNameWithArguments
// also copy back constructed value parms here so the correct copy is destroyed when the event function returns


This would be the obvious reason for getting the garbage memory from before, as I was pointing to the wrong memory address (func), when in fact, I was supposed to pass in the memory address of the container that actually contained the value (After ProcessEvent took place).

I’m still pretty raw on memory.

Thanks for your help.