Steamworks Callback fails to compile in UE4 - Error Unrecognized Type GameOverlayActivated_t , Must be UCLAS, USTRUCT or ENUM

Hello, I am trying to work with Steamworks lately, and I am trying to do a simple event of pausing my game when the Steam Game Overlay becomes active.

I created a c++ Game Instance class in my game, and I can load it up in the game, as I can create and modify a variable in it. When I write the following code

Header file

include “Engine/GameInstance.h”

include “MusicalRangeInstance.generated.h”

void SteamOverlayActive();

UFUNCTION(BlueprintPure, category = "Steamworks")
bool OnSteamOverlayEnabled(GameOverlayActivated_t *pResult, bool bIOFailure);
CCallResult<UMusicalRangeInstance, GameOverlayActivated_t> m_callResultGameOverlayActive;

And then in cpp file

include “MusicalRange.h”

include “MusicalRangeInstance.h”

include “ThirdParty/Steamworks/Steamv132/sdk/public/steam/steam_api.h”

void UMusicalRangeInstance::SteamOverlayActive() {
SteamAPICall_t hSteamAPICall = SteamUtils()->IsOverlayEnabled();
m_callResultGameOverlayActive.Set(hSteamAPICall, this, &UMusicalRangeInstance::OnSteamOverlayEnabled);

bool UMusicalRangeInstance::OnSteamOverlayEnabled(GameOverlayActivated_t *pResult, bool bIOFailure) {
return bIOFailure || (pResult->m_bActive == false);


The problem I have, is that the c++ compile for UE4 says that GameOverlayActivated_t is not a valid structure. I haven’t been able to find anything on this problem online. I am quite noob when it comes to Steamworks coding, and I am having a lot of trouble understanding the documentation just like that. Examples would be best. Like, it has an example for Call Results, but not really for Callbacks at Steamworks API Overview (Steamworks Documentation)

The UHT does not know the the type GameOverlayActivated_t, and thus you cannot use it in UFUNCTIONS.
Use a normal C++ Function as callback, copy the contents of GameOverlayActivated_t into a Structure that you define, and use this structure as parameter for you UFUNCTION.
I cannot give an example, because i never worked with the steam api yet.

I managed to solve this after some tinkering. I have no idea if the Steamworks function I am trying to implement works at all, but at least it compiles now.

Header ended like this

include "ThirdParty/Steamworks/Steamv132/sdk/public/steam/steam_api.h"
include "Engine/GameInstance.h"
include "MusicalRangeInstance.generated.h"

void SteamOverlayActive();

//UFUNCTION(BlueprintPure, category = "Steamworks")
void OnSteamOverlayEnabled(GameOverlayActivated_t *pResult, bool bIOFailure);
CCallResult<UMusicalRangeInstance, GameOverlayActivated_t> m_callResultGameOverlayActive;

I had to change OnSteamOverlayEnabled from Void to Bool, and get rid of the UFUNCTION macro.

On the CPP file I have the same include files as before but I had to change the OnSteamOverlayEnable code,

 void UMusicalRangeInstance::OnSteamOverlayEnabled(GameOverlayActivated_t *pResult, bool bIOFailure) {
IsSteamOverlayActive = (pResult->m_bActive != 0);

With those changes it compiles.