# SimConnect_SubscribeToFacilities_EX1 The **SimConnect\_SubscribeToFacilities\_EX1** function is used to request notifications when a facility of a certain type is added to the facilities cache, with the ability to specify callbacks.   ##### Syntax ``` cpp HRESULT SimConnect_SubscribeToFacilities_EX1( HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type, SIMCONNECT_DATA_REQUEST_ID newElemInRangeRequestID, SIMCONNECT_DATA_REQUEST_ID oldElemOutRangeRequestID ); ```   ##### Parameters
ParameterDescriptionType
hSimConnectHandle to a SimConnect object.Integer
typeSpecifies one member of the SIMCONNECT_FACILITY_LIST_TYPE enumeration type.Enum
newElemInRangeRequestID

Request Id for messages about new elements considered to be in range of the reality bubble. If -1 is used, then the client won't receive messages for elements coming into range.

NOTE: This cannot be set to -1 if oldElemOutRangeRequestID is also -1.

Integer
oldElemOutRangeRequestID

Request Id for messages about an element that is newly considered out of range of the reality bubble. If -1 is used, then the client won't receive messages for elements coming into range.

NOTE: This cannot be set to -1 if newElemInRangeRequestID is also -1.

Integer
  ##### Return Values The function returns an **HRESULT**. Possible values include, but are not limited to, those in the following table. {{< table-wrapper >}} | Return value | Description | |--------------|-------------------------| | `S_OK` | The function succeeded. | | `E_FAIL` | The function failed. | {{< /table-wrapper >}}   ##### Remarks This function is a version of the [`SimConnect_SubscribeToFacilities`](simconnect-subscribetofacilities/) and works in almost the exact same way with one exception. Using `SIMCONNECT_FACILITY_LIST_TYPE_AIRPORT` will now return a list of the airports within the current reality bubble, *not* the entire world. You can also specify the callbacks to use when a facility either enters or leaves the reality bubble. Note that to unsubscribe you should use the companion function [`SimConnect_UnsubscribeToFacilities_EX1`](simconnect-unsubscribetofacilities-ex1/).   ##### See Also - [SimConnect API Reference](../../simconnect-api-reference/) - [SimConnect\_UnsubscribeToFacilities\_EX1](simconnect-unsubscribetofacilities-ex1/) - [SimConnect\_RequestFacilitiesList](simconnect-subscribetofacilities/) - [SimConnect\_SubscribeToFacilities](simconnect-subscribetofacilities/)