Convert BlackboardKeySelector to Object

Guys Im trying to convert this peace of blueprint code to c++. I have already tried casting but VS throws me compilation error. I searched in google and documentation nearly for 4 hours, but I couldn’t find anything helpful, so this is my last hope

const UObject* Object = BlackboardComponent->GetValueAsObject( BlackboardKey.SelectedKeyName );