SimConnect_CallDispatch

The SimConnect_CallDispatch function is used to process the next SimConnect message received, through the specified callback function.

 

Syntax
HRESULT SimConnect_CallDispatch(
    HANDLE  hSimConnect,
    DispatchProc  pfcnDispatch,
    void *  pContext
    );

 

Parameters
Parameter Description Type
hSimConnect Handle to a SimConnect object. Integer
pfcnDispatch Specifies the callback function. For a definition of the function see DispatchProc. Integer
pContext Specifies a pointer that the client can define that will be returned in the callback. This is used in particular by managed code clients to pass a this pointer to the callback. 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.

 

Example
int quit = 0;
while( quit == 0 ) {  
    hr = SimConnect_CallDispatch(hSimConnect, MyDispatchProc, NULL);
    };

 

Remarks

It is important to call this function sufficiently frequently that the queue of information received from the server is processed (typically it is coded within a while loop that terminates when the application is exited).

 

See Also