SimConnect_CallCommBusEvent
The SimConnect_CallCommBusEvent function is used to call a communication (CommBus) event.
Syntax
HRESULT SimConnect_CallCommBusEvent(
HANDLE hSimConnect,
const char * EventName,
SIMCONNECT_COMM_BUS_BROADCAST_TO BroadcastTo,
DWORD BufferSize,
const char * Data
);
Parameters
| Parameter | Description | Type |
|---|---|---|
| hSimConnect | Handle to a SimConnect object. | Integer |
| EventName | Specifies the name of the event to call. Name of the event to call. Note that there is no need to register the event in the client prior to calling it. | Integer |
| BroadcastTo | One of the SIMCONNECT_COMM_BUS_BROADCAST_TO enum members that defines where the event should be broadcast (WASM, JS, or SimConnect). |
Integer |
| BufferSize | This is the size (in bytes) of the Data buffer. |
Integer |
| Data |
This is the data to send alongside the event. The data will be received differently depending on the receiving platform:
|
String |
Return Values
The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
| Return value | Description |
|---|---|
| S_OK | The function succeeded. |
| E_FAIL | The function failed. |
Syntax
void SimConnect::CallCommBusEvent(
string EventName,
SIMCONNECT_COMM_BUS_BROADCAST_TO BroadcastTo,
object Data
);
Parameters
| Parameter | Description | Type |
|---|---|---|
| EventName | Specifies the name of the event to call. Note that there is no need to register the event in the client prior to calling it. | String |
| BroadcastTo | One of the SIMCONNECT_COMM_BUS_BROADCAST_TO enum members that defines where the event should be broadcast (WASM, JS, or SimConnect). |
Enum |
| Data |
An abstract object containing the data to send with the event, which will be will be converted with Marshal into a pointer and a size. The data will be received differently depending on the receiving platform:
|
Object |
Return Values
N/A (use a try/catch to test for errors).
Remarks
N/A
0/255