DECLARE_DYNAMIC_DELEGATE_ThreeParams() Error

I’m getting an error every time I try to include DECLARE_DYNAMIC_DELEGATE_ThreeParams(); into my .h file. The error says “this declaration has no storage class or type specifier” and that FOnProgress is undefined. I’ve tried to include the Delegates/Delegate.h header file, but still getting the same error. I’ve also tried to regenerate my project but still didn’t fix this error. What am I doing wrong? Is it a bug?

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "Http.h"
#include "Delegates/Delegate.h"
#include "Download.generated.h"

DECLARE_DYNAMIC_DELEGATE_ThreeParams(FOnProgress, const int32, BytesSent, const int32, BytesRecieved, const int32, contentLenght);
//
UCLASS()
class Download_API Downloader : public UObject
{
	GENERATED_BODY()

public:

	FOnProgress OnProgress;
};

I did what you suggested and got it to work. Thank you!

Rather than there being an error here, this feels to me like a stupid intellisense/compiliation problem. Reading around at similar problems, it seems like they all recommend the following (all in Visual Studio)

  1. Switch the Solution Configuration (its one of the dropdown menus at the top, next to where you press the green start for the debugger) to any other setting
  2. Recompile - this will force all of the headers to be recompiled
  3. Switch back to the original setting and recompile again

If it is some intellisense or compilation error, this should resolve it. I appreciate you said you’ve already regenerated the project but, my previous experience with things like this is sometimes event that doesn’t cut it…

1 Like

Solution:

  1. Switching the Solution Configuration to any other setting. 2) Recompiling - this will force all of the headers to be recompiled. 3) Switching back to the original setting and recompiling again.
1 Like