SimConnect_SubscribeToCommBusEvent
The SimConnect_SubscribeToCommBusEvent function is used to subscribe the client to a communication (CommBus) event to receive a SIMCONNECT_RECV_ID_COMM_BUS when the event is called.
Syntax
HRESULT SimConnect_SubscribeToCommBusEvent(
HANDLE hSimConnect,
SIMCONNECT_CLIENT_EVENT_ID EventID,
const char * EventName
);
Parameters
| Parameter | Description | Type |
|---|---|---|
| hSimConnect | Handle to a SimConnect object. | Integer |
| EventID | Specifies the ID which will be used to identify the event. | Integer |
| EventName |
The string name for the CommBus event to subscribe to. |
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::SubscribeToCommBusEvent(
Enum EventID,
string EventName
);
Parameters
| Parameter | Description | Type |
|---|---|---|
| EventID | Specifies the ID of the client event. | Enum |
| EventName |
The string name for the CommBus event to subscribe to. |
Enum |
Return Values
N/A (use a try/catch to test for errors).
Remarks
N/A
0/255