AddDynamic must have class/struct/union

Let me say first I Hate Event Callbacks…

Ok so i have some events in my Class HudControl

public:
	UFUNCTION(BlueprintNativeEvent, Category=MouseEvent)
	void OnMouseClick();

The problem comes why i try to add a C++ coded event into the event. so i have

UQuestWindow::UQuestWindow(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
	this->SetUp(0, 0, 450, 550, true);

	UHudWindowButton* AcceptBtn = NewObject<UHudWindowButton>();
	AcceptBtn->SetUp(this->GetBounds().right - 116, this->GetBounds().bottom - 32, 116, 32, true);
	AcceptBtn->SetText("  Accept");
	AcceptBtn->OnMouseClick.AddDynamic(this, &UQuestWindow::AcceptButtonClick);
}

void UQuestWindow::AcceptButtonClick(){
	FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(TEXT("Button Clicked")));
	this->Disable();
}

But all i get is

Error 1 error C2228: left of ‘.__Internal_AddDynamic’ must have class/struct/union {OMITED}\Unreal Projects\Assesment2\Source\Assesment2\QuestWindow.cpp 14 1 Assesment2

How do i bind my event in QuestWindow to the UFunction Event i have created in the HudWindowButton Class?

So Apparently The Way i was doing it was not working,

So i set up

DECLARE_DELEGATE(MouseEvent)

Then Set the OnMouseClick to be

MouseEvent OnMouseClick

To Bind a C++ Coded Event to it you can’t use AddDynamic it only works like

AcceptBtn->OnMouseClick.BindUObject(this, &UQuestWindow::AcceptButtonClick);

And when using it you use

OnMouseClick.ExecuteIfBound();

Thanks! That’s what I was looking for.