The SimConnect_GetLastSentPacketID function returns the ID of the last packet sent to the SimConnect server.


HRESULT SimConnect_GetLastSentPacketID(
    HANDLE  hSimConnect,
    DWORD*  pdwSendID


Parameter Description Type
hSimConnect Handle to a SimConnect object. Integer
pdwSendID Pointer to a double word containing the ID of the last sent packet. Integer


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.


hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_MY_EVENT, "Custom.Event");
hr = SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_MY_EVENT, 0, SIMCONNECT_GROUP_PRIORITY_HIGHEST, 0);
hr = SimConnect_GetLastSentPacketID(hSimConnect, &dwLastID);



This function should be used in conjunction with returned structures of type SIMCONNECT_RECV_EXCEPTION to help pinpoint errors (exceptions) returned by the server. This is done by matching the send ID returned with the exception, with the number returned by this function and stored appropriately. This function is primarily intended to be used while debugging and testing the client application, rather than in a final retail build.


See Also