The SimConnect_AIRemoveObject function is used to remove any object created by the client using one of the AI creation functions.

 

Syntax
HRESULT SimConnect_AIRemoveObject(
    HANDLE  hSimConnect,
    SIMCONNECT_OBJECT_ID  ObjectID,
    SIMCONNECT_DATA_REQUEST_ID  RequestID
    );

 

Parameters
ParameterDescriptionType
hSimConnectHandle to a SimConnect object.Integer
ObjectIDSpecifies the server defined object ID (refer to the SIMCONNECT_RECV_ASSIGNED_OBJECT_ID structure).Integer
RequestIDSpecifies the client defined request ID.Integer

 

Return Values

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return valueDescription
S_OKThe function succeeded.
E_FAILThe function failed.

 

Remarks

A client application can only remove AI controlled objects that it created, not objects created by other clients, or by the simulation itself.