# How to receive broadcast from DECLARE\_EVENT\_OneParam?

**URL:** <https://forums.unrealengine.com/t/how-to-receive-broadcast-from-declare-event-oneparam/490812>\
**Category:** C++\
**Tags:** add, unreal-engine, CPP, question\
**Created:** [November 11, 2021, 5:16am UTC](https://forums.unrealengine.com/t/how-to-receive-broadcast-from-declare-event-oneparam/490812 "2021-11-11T05:16:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_23fd56db](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_23fd56db](https://forums.unrealengine.com/u/anonymous_user_23fd56db)\
**Post date:** [November 11, 2021, 5:16am UTC](https://forums.unrealengine.com/t/how-to-receive-broadcast-from-declare-event-oneparam/490812/1 "2021-11-11T05:16:53Z")

</div>

I have got the following chunks of code:

## MenuWidget.h

```
DECLARE_EVENT_OneParam(UMenuWidget,OnClickedButtonOpenEvent,int);
	OnClickedButtonOpenEvent Var;

```

## MenuWidget.cpp

```
int send {8};
	Var.Broadcast(send);

```

## MyPlayerController.cpp

```
void AMyPlayerController::nothing2(int x) {
	GEngine->AddOnScreenDebugMessage(
		21,200,FColor::Yellow,FString::Printf(TEXT("nothing2(%d)"),x)
	);
}

```

How can I receive the event-broadcast here in **MyPlayerController.cpp** , to be attached to **AMyPlayerController::nothing2**?

I tried:

 ![351960-ue.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/3/33368e4f46bb4248978a66e9597a618b37381f60.png)

**NOTE:** Everything needs to be in C++, no BPs.
