OverviewThe SimConnect SDK can be used by programmers to write add-oncomponents for Flight Sim World. Add-oncomponents for Flight Sim World can be writtenin C or C++. Typically the components will perform one or more of thefollowing:
See AlsoSetupThis section describes how to set up a development environment for SimConnect.
SimConnect ProjectsTo build SimConnect add-ons, you must use Visual Studio 2015 or later. To build the project make sureyou have completed the following steps. C/C++ Projects
DLL Projects
All Projects
The SimConnect.ini fileThe default SimConnect.ini file will enable the debug window and disable the log file. Use a semi-colon to start a comment, or comment out a directive. The file should be in your My Documents\Flight Sim World folder.
The SimConnect.cfg fileThe SimConnect.cfg file contains communications information for a client (the SimConnect.xml file contains information for a server). This file is only required if a client is going to access Flight Sim World running on a remote machine, and should be placed in the My Documents folder, or in the same folder as the client application or library, on the computer the client is running on. The SimConnect.cfg file can contain a number of configurations, identified in sections with the [SimConnect.N] title. The index number is used as a parameter in the SimConnect_Open function. This is useful for applications that communicate with a number of different machines that are running Flight Sim World. The default configuration index is zero, and if there is only one configuration in the file, no index number is required.
The EXE.xml and DLL.xml filesThese files contain all the clients that will be activated by Flight Sim World on start up. EXE.xml should contain all the .exe application add-ons, and DLL.xml should contain all the .dll library based add-ons. To activate just your one client, edit the appropriate file so it matches the following table, with the name and path to your client replacing the text in bold. The format of both files is identical. Both files should be in the %APPDATA%\Dovetail Games\FSW folder. For each library add-on enter the following information into DLL.xml, and for each application add-on enter the following information into EXE.xml:
Sample DLL.xml fileThe following sample DLL.xml file contains two add-ons, the first enabled and the second disabled. All of the add-ons can be disabled by setting the global <Disabled> entry to True. If the global <ManualLoad> is set to True, then the user will be prompted with a dialog as to whether they would like the add-ons to be loaded or not (this overrides the local <ManualLoad> setting for the individual add-ons).
NoteAll that including a file in the EXE.xml or DLL.xml file does is ensure that it starts up along with Flight Sim World (as long as Disabled is set to false). It does not ensure that the program is terminated when the user exits from Flight Sim World, this has to be handled from within the client itself. For almost all applications terminating at the same time would be desirable, though for monitoring applications it may well of course be desirable that the client is left running after the simulator exits. It is also possible for the user to click on and start any client application at any time, whether Flight Sim World is running or not. The two xml files are provided for convenience only, it is not a requirement for any client to be added to these files. Note that if Flight Sim World starts an EXE, then Steam will consider the program to be active until both the sim and the addon EXE are terminated. The SimConnect.xml fileThis file contains communication information for the SimConnect server (the SimConnect.cfg file contains information for a client). The default behaviour for the Flight Sim World SDK is that three servers are initiated by the system, for local communcation using one of each of the three protocols: Pipe, IPv4, and IPv6. These servers do not require entries in the xml file. Prior to this SDK, the default behaviour was to open a single server, using the protocol IPv6 in preference to IPv4. The Simconnect.xml file is not needed if this covers the communication requirements. If remote connections are required, then one entry will need to be made in this file to cover each type of remote communication that needs to be supported (see the sample SimConnect.xml file). The following table describes the file format. The file should be placed in the in the %APPDATA%\Dovetail Games\FSW folder on the computer the server is running on.
Design ConsiderationsThe design of a SimConnect add-on involves writing a client to communicate with a server running within Flight Sim World. The client opens up communications with the server, then requests that certain events and certain object information are passed to it. The client then waits for the information to be received from the server, and then processes it appropriately. SimConnect makes extensive use of ID numbers defined by the client. There are ID numbers for requests, data definitions, events, groups, and so on. These ID numbers should be unique for the client. Re-using an ID will result in the previous call using that ID becoming obsolete, and ignored by the server. It is a good idea to check out control sequences (such as start-up) in the simulator itself, before trying to code those sequences using SimConnect calls. Note that there can be subtle improvements in the modeling of the gauges of an aircraft between versions of the simulation that might change some of the sequences. VersioningSimConnect clients will not work with any simulator released previously to Flight Sim World. Only one version of Flight Sim World can be running on one computer at a time, so a client installed on a local machine will only be communicating with one server. However it is possible to have one client communicate with multiple copies of Flight Sim World, running on a network. The SimConnect client library used by Flight Sim World will be located in the game's root folder. Only this version will be compatible with the sim, so old versions of the DLL should not be distributed. The syntax of existing functions will not be changed in future versions of SimConnect, although additional functions may be added. SimConnect API ReferenceThis section lists all the API functions, structures, enumerations, andother coding information necessary to build SimConnect clients.Information on each API call includes some example code. This code does not form a complete program in any sense, but simplyhighlights the uses of the API call. The Reference Samples sections list run-able sample code.
General FunctionsDispatchProcThe DispatchProc function is a written bythe developer of the SimConnect client, as a callback function tohandle all the communications with the server. Syntaxvoid CALLBACK DispatchProc( ParameterspData pContext Return ValuesThis function does not return a value. Example
Reference Samples
RemarksThis function can be named appropriately by the clientdeveloper. The name of the function is passed to the client-sidelibrary with the SimConnect_CallDispatchfunction call. Handle all thecallback events in this function. If you do not wish to implement acallback function use SimConnect_GetNextDispatch.
To receive time based notifications, see the SimConnect_SubscribeToSystemEvent function. To receive event based notifications see the SimConnect_AddClientEventToNotificationGroup function. To send an event to be received by other clients, see the SimConnect_TransmitClientEvent function. See AlsoSimConnect_AddClientEventToNotificationGroupThe SimConnect_AddClientEventToNotificationGroup function is used to add an individual client defined event to a notification group. SyntaxHRESULT SimConnect_AddClientEventToNotificationGroup( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Examplestatic enum EVENT_ID { Reference Samples
RemarksThe maximum number of events that can be added to a notification group is 1000. A notification group is simply a convenient way of setting the appropriate priority for a range of events, and all client events (such as EVENT_1, EVENT_2, EVENT_3 in the example above) must be assigned to a notification group before any event notifications will be received from the SimConnect server. See Also
SimConnect_AddToClientDataDefinitionThe SimConnect_AddToClientDataDefinition function is used to add an offset and a size in bytes, or a type, to a client data definition. SyntaxHRESULT SimConnect_AddToClientDataDefinition( ParametershSimConnect
Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksThis function must be called before a client data area can be written to or read from. Typically this function would be called once for each variable that is going to be read or written. Note that an error will not be given if the size of a data definition exceeds the size of the client area - this is to allow for the case where definitions are specified by one client before the relevant client area is created by another.
The most efficient use of client data areas is to group data that changes at the same time into the same data area. Minor performance improvements are gained by not using tagged data, or the fEpsilon parameter, if they are not needed.
Note that this function has been updated for the SP1a release of the SDK. Clients written for the previous version of this function will still compile and run, this new function simply expands on the functionality provided. See Also
SimConnect_AddToDataDefinitionThe SimConnect_AddToDataDefinition function is used to add a Flight Sim World simulation variable name to a client defined object definition. SyntaxHRESULT SimConnect_AddToDataDefinition( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Example
Reference Samples
RemarksThe maximum number of entries in a data definition is 1000. See Also
SimConnect_CallDispatchThe SimConnect_CallDispatch function is used to process the next SimConnect message received, through the specified callback function. SyntaxHRESULT SimConnect_CallDispatch( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Example int quit = 0; Reference Samples
RemarksIt 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). However, if the project involves developing a library (DLL) rather than an application (EXE) then only one call to this function is necessary. This call will store the name of the callback in a cache, and whenever a packet is sent to the client, the callback function will be run. The format of a DLL project is shown in the following table:
See AlsoSimConnect_ClearClientDataDefinitionThe SimConnect_ClearClientDataDefinition function is used to clear the definition of the specified client data. SyntaxHRESULT SimConnect_ClearClientDataDefinition( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksNone. See Also
SimConnect_ClearDataDefinitionThe SimConnect_ClearDataDefinition function is used to remove all simulation variables from a client defined data definition. SyntaxHRESULT SimConnect_ClearDataDefinition( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Examplestatic enum DATA_DEFINE_ID { RemarksUse this function to permanently delete a data definition. To temporarily suspend data requests see the remarks for the SimConnect_RequestDataOnSimObject function. See Also
SimConnect_ClearInputGroupThe SimConnect_ClearInputGroup function is used to remove all the input events from a specified input group object. SyntaxHRESULT SimConnect_ClearInputGroup( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Example static enum INPUT_ID { RemarksUse this function to permanently delete an input group. Use the SimConnect_SetInputGroupState function to temporarily suspend input group notifications. See Also
SimConnect_ClearNotificationGroupThe SimConnect_ClearNotificationGroup function is used to remove all the client defined events from a notification group. SyntaxHRESULT SimConnect_ClearNotificationGroup( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Examplestatic enum EVENT_ID { RemarksThere is a maximum of 20 notification groups in any SimConnect client. Use this function if the maximum has been reached, but one or more are not longer required. See Also
SimConnect_CloseThe SimConnect_Close function is used torequest that the communication with the server is ended. SyntaxHRESULT SimConnect_Close( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possiblevalues include, but are not limited to, those in the following table.
Examplehr =SimConnect_Close(hSimConnect); Reference Samples
RemarksWhen a SimConnect client is closed, the server will remove all objects, menu items, group definitions and so on, defined or requested by that client, so there is no need to remove them explicitly in the client code. See AlsoSimConnect_CreateClientDataThe SimConnect_CreateClientData function is used to request the creation of a reserved data area for this client. SyntaxHRESULT SimConnect_CreateClientData( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksUse this function, along with the other client data functions, to reserve an area of memory for client data on the server, that other clients can have read (or read and write) access to. Specify the contents of the data area with the SimConnect_AddToClientDataDefinition call, and set the actual values with a call to SimConnect_SetClientData. Other clients can receive the data with a call to SimConnect_RequestClientData.
The maximum size of a client data area is set by the constant SIMCONNECT_CLIENTDATA_MAX_SIZE. For the RTM version of Flight Sim World this was 4K, for the SP1A update to the SDK it is 8K. If an add-on is to work with the RTM version, a 4K limit should be adhered to. There is no maximum number of client data areas, but the total must not exceed 1Mbyte for the SP1A update, or 100K for the RTM version. If a request is made for a client data area greater than SIMCONNECT_CLIENTDATA_MAX_SIZE a SIMCONNECT_EXCEPTION_INVALID_DATA_SIZE exception is returned. If a request is made for a client data area that will exceed the total maximum memory a SIMCONNECT_EXCEPTION_OUT_OF_BOUNDS exception is returned.
One client area can be referenced by any number of client data definitions. Typically the name of the client area, and the data definitions, should be published appropriately so other clients can be written to use them. Care should be taken to give the area a unique name.
Once created, a client data area cannot be deleted or reduced in size. To increase the size of the data area, first close the connection, then re-open it and request the client data area again, using the same name, but with the required size. The additional data area will be initialized to zero, but the previous data will be untouched by this process. Client data persists to the end of the Flight Sim World session, and is not removed when the client that created it is closed. It is also possible to change a read-only data area to write-able using this technique. See Also
SimConnect_Draw3DLinesThe SimConnect_Draw3DLines function is used to put simple wireframe shapes into the world. SyntaxHRESULT SimConnect_Draw3DLines( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksThis function draws simple, unlit, line vectors in 3D space. It is intended to show things like boundary boxes and does not support animation or solid vector objects. Each point is defined as an offset in meters from the shape's location. Lines are drawn between each point in the array and the next, except where a point is defined as being the last in a segment, and each line can have it's own colour. There is a limit of 1000 points in the vertex array. A line set can be replaced by sending a second request with the same DefineID, and removed by sending an empty list with the original DefineID. See AlsoSimConnect_Draw3DTextThe SimConnect_Draw3DText function is used to put simple billboard text similar to aircraft labels into the world. SyntaxHRESULT SimConnect_Draw3DText( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksThis function draws simple, unlit, small text in the world which will always face the screen. It is intended for use in labelling items of interest. Text can be replaced by sending a second request with the same DefineID, and removed by sending an empty string with the original DefineID. See AlsoSimConnect_FlightLoadThe SimConnect_FlightLoad function is used to load an existing flight file. SyntaxHRESULT SimConnect_FlightLoad( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksFlight files can be opened using a text editor. See AlsoSimConnect_FlightPlanLoadThe SimConnect_FlightPlanLoad function is used to load an existing flight plan file. SyntaxHRESULT SimConnect_FlightPlanLoad( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksFlight plan files can be opened using a text editor. See AlsoSimConnect_FlightSaveThe SimConnect_FlightSave function is used to save the current state of a flight to a flight file. SyntaxHRESULT SimConnect_FlightSave( ParametershSimConnect [in] Null-terminated string containing the title of the flight file. If this is NULL then the szFileName parameter is used as the title.szDescription [in] Null-terminated string containing the text to enter in the Description field of the flight file. Flags Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksFlight files can be opened using a text editor. See AlsoSimConnect_GetLastSentPacketIDThe SimConnect_GetLastSentPacketID function returns the ID of the last packet sent to the SimConnect server. SyntaxHRESULT SimConnect_GetLastSentPacketID( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Example
Reference Sample
RemarksThis 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 AlsoSimConnect_GetNextDispatchThe SimConnect_GetNextDispatch function is used to process the next SimConnect message received, without the use of a callback function. SyntaxHRESULT SimConnect_GetNextDispatch( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Example SIMCONNECT_RECV* pData; SIMCONNECT_RECV_WEATHER_OBSERVATION structure. SIMCONNECT_RECV_WEATHER_OBSERVATION* pWxData =(SIMCONNECT_RECV_WEATHER_OBSERVATION*) pData; Reference Sample
RemarksIt is important to call this function sufficiently frequently that the queue of information received from the server is processed. If there are no messages in the queue, the dwID parameter will be set to SIMCONNECT_RECV_ID_NULL. See AlsoSimConnect_MapClientDataNameToIDThe SimConnect_MapClientDataNameToID function is used to associate an ID with a named client data area. SyntaxHRESULT SimConnect_MapClientDataNameToID( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksThis function should be called once for each client data area: the client setting up the data should call it just before a call to SimConnect_CreateClientData, and the clients requesting the data should call it before any calls to SimConnect_RequestClientData are made. The name given to a client data area must be unique, however by mapping an ID number to the name, calls to the functions to set and request the data are made more efficient. See Also
SimConnect_MapClientEventToSimEventThe SimConnect_MapClientEventToSimEvent functionassociates a client defined event ID with a Flight Sim World event name. SyntaxHRESULT SimConnect_MapClientEventToSimEvent( ParametershSimConnect Alternatively enter a decimal number in the format "#nnnn" or a hex number in the format "#0xnnnn", where these numbers are in the range THIRD_PARTY_EVENT_ID_MIN and THIRD_PARTY_EVENT_ID_MAX, in order to receive events from third-party add-ons to Flight Sim World. Return ValuesThe function returns an HRESULT. Possiblevalues include, but are not limited to, those in the following table.
Example
Reference Samples
RemarksClient events, such as EVENT_BRAKES, must be added to a groupevent (to set the appropriate priority) before event notifications willbe received from the SimConnect server (see the SimConnect_AddClientEventToNotificationGroupfunction). See AlsoSimConnect_MapInputEventToClientEventThe SimConnect_MapInputEventToClientEvent function is used to connect input events (such as keystrokes, joystick or mouse movements) with the sending of appropriate event notifications. SyntaxHRESULT SimConnect_MapInputEventToClientEvent( ParametershSimConnect bMaskable Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Example
Reference Samples
RemarksThe maximum number of events that can be added to an input group is 1000.
For the keyboard the input definition can include a maximum of two modifiers (Shift, Ctrl, Alt) and two keys (case sensitive).
Note that if you request "mouse" inputs using this function, this is taken as requesting mouse-yoke input, not general mouse movements or inputs. To receive pure mouse input regardless of mouse-yoke mode, use a pszInputDefinition of "rawmouse". Mouse button and movement data will be returned using the event DownEventID, in a SIMCONNECT_RECV_EVENT_RAWMOUSE structure. Keyboard control, shift and alt key states are also returned. Rawmouse events are evaluate per-frame.
For joysticks the input definition is in the form "joystick:n:input[:i]". Where n is the joystick number (starting from 0), input is the input name, and i is an optional index number that might be required by the input name (joystick:0:button:0 for example). The input name can be one in the following table:
For keyboard hits, usually no further information other than the key has been pressed is necessary for the client to process the event appropriately. For joystick events, other than button events, it is also important to know the extent of the movement (or position of the hat switch, or of the slider). This information is returned with the event in the dwData parameter of a SIMCONNECT_RECV_EVENT structure.
For button, hat switch, or keyboard events, one event is transmitted to the client, or two if an up event is specified, when the input event occurs. If joystick axis, rotation or slider events are requested, then an event is transmitted for these six times per second whether the joystick is actually moved or not, unless the value for these is zero, in which case events are not transmitted until the joystick is moved from this position. Joystick and keyboard events are only transmitted when a flight is loaded, not while the user is navigating the shell of the product.
For reference, the default input mappings of joystick buttons to events is specified in the Standard.xml file in the root Flight Sim World folder. The first time Flight Sim World is run, a subset of this file is written out to a file with the same name in the %APPDATA%/Dovetail Games/FSW/Controls folder, containing just the mappings that the current setup is using. Each time Flight Sim World is run the smaller file is read in, and is the first used to find a mapping for a device. If a mapping is not found the larger file in the root folder is opened and searched (and a successful mapping added to the internal copy of the file). A generic mapping is used if no match is found. The file is written out again when the simulation is exited, obviously containing any new mappings. It is usually safe for a third-party to update the smaller version of Standard.xml with correct and appropriate mappings, as long as this does not happen while Flight Sim World is running, as in this case the file will be over-written. Standard.xml replaces the file devices.cfg used in earlier versions of Flight Sim World.
See Also
SimConnect_OpenThe SimConnect_Open function is used to send a request to the Flight Sim World server to open up communications with a new client. SyntaxHRESULT SimConnect_Open( ParametersphSimConnect To ensure that a configuration file is not read accidentally, for example when creating a .dll addon that is only to work locally, enter SIMCONNECT_OPEN_CONFIGINDEX_LOCAL for this parameter, which will force local operation regardless of the existence of any configuration files. Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Example HRESULT hr; Reference Samples
RemarksMost client applications will have one SimConnect_Open call, and one corresponding SimConnect_Close call. However in some applications, multiplayer in particular, multiple SimConnect_Open calls may be necessary, in which case an array or list of handles will need to be maintained, and closed appropriately.
A client can optionally examine the SIMCOMMENT_RECV_OPEN structure that is returned after a call to SimConnect_Open. This structure gives versioning and build information that should be useful when multiple versions of SimConnect and multiple versions of Flight Sim World that support it, are available.
If a remote client successfully establishes a link with Flight Sim World, but at some later time the network connection is lost, SimConnect functions will return the NTSTATUS error STATUS_REMOTE_DISCONNECT (0xC000013CL).
The SIMCONNECT_EXCEPTION_VERSION_MISMATCH exception will be returned if a versioning error has occurred, typically when a client built on a newer version of the SimConnect client dll attempts to work with an older version of the SimConnect server. See AlsoSimConnect_RemoveClientEventThe SimConnect_RemoveClientEvent function is used to remove a client defined event from a notification group. SyntaxHRESULT SimConnect_RemoveClientEvent( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Examplestatic enum EVENT_ID { RemarksUse this function to permanently remove the client event. There is no reliable procedure to temporarily turn off a client event. See Also
SimConnect_RemoveInputEventThe SimConnect_RemoveInputEvent function is used to remove an input event from a specified input group object. SyntaxHRESULT SimConnect_RemoveInputEvent( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Example static enum INPUT_ID { RemarksThe input string definitions must match exactly, before anything is removed from the group definition. For example, the string definitions "A+B" and "a+B" do not match. See Also
SimConnect_RequestClientDataThe SimConnect_RequestClientData function is used to request that the specified data in an area created by another client be sent to this client. SyntaxHRESULT SimConnect_RequestClientData( ParametershSimConnect Flags
origin interval limit Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksA data definition must be specified, using the SimConnect_AddToClientDataDefinition function, before this function can be called If the data definition exceeds the size of the client data area on the server, then the extra bytes will be filled with zeros, an error will not be returned.
The data will be returned in a SIMCONNECT_RECV_CLIENT_DATA structure.
See the remarks for SimConnect_RequestDataOnSimObject, as the two functions work in a very similar manner.
This function has been updated for the SP1a release of the SDK, expanding on its functionality. See Also
SimConnect_RequestDataOnSimObjectThe SimConnect_RequestDataOnSimObject functionis used to request when the SimConnect client is to receive data valuesfor a specific object. SyntaxHRESULT SimConnect_RequestDataOnSimObject( ParametershSimConnect Flags
origin interval limit Return ValuesThe function returns an HRESULT. Possiblevalues include, but are not limited to, those in the following table.
Example
Reference Samples
RemarksChanging the Period parameter or changing the content of a data definition has a higher performance cost than changing the origin, interval or limit parameters. So to temporarily turn off data requests, especially for short periods of time, consider setting the interval parameter to a very high value (such as DWORD _MAX). If changes are required to a data definition, consider setting the Period parameter to SIMCONNECT_PERIOD_NEVER (see the SIMCONNECT_PERIOD enumeration) before making the changes, and then turning on the appropriate period after the changes have been made.
It is possible to change the period of a request, by resending the SimConnect_RequestDataOnSimObject call with the same RequestID, DefineID and ObjectID parameters, but with a new period. The one exception to this is the new period cannot be SIMCONNECT_PERIOD_ONCE, in this case a request with a new RequestID should be sent.
Data is always transmitted with the SimConnect_RequestDataOnSimObject function, so if timing only notifications are required, use the SimConnect_SubscribeToSystemEvent function.
Note that variable length strings should not be used in data definitions, except where the Period parameter has been set to SIMCONNECT_PERIOD_ONCE.
One method of testing whether the user has changed aircraft type is to use this function to return the title of the user aircraft, and note that if it changes, the user has changed the type of aircraft (all aircraft types have unique title strings, including those simply with different color schemes). An example of requesting the aircraft title is in the Variable Strings reference sample. See the Aircraft Configuration Files document for more details on titles.
If boolean data has been requested as part of a data definition, note that the only reliable numeric equivalent is that 0 is returned for False. Non-zero values, especially both 1 and -1, are used to indiate True.
Note: Multiplayer ModeWhen developing a client for use in multiplayer mode it is not safe to use the ID number for the user aircraft returned by the function SimConnect_RequestDataOnSimObjectType, as the actual number can change depending on several factors, including the number of users involved in the multiplayer flight. Always use the constant SIMCONNECT_OBJECT_ID_USER for the ObjectID parameter if the SimConnect client is to work in multiplayer mode. Also note that in this mode it is good practice to remove any calls associated with periodic data on AI objects and to remove subscriptions to AI objects. See Also
SimConnect_RequestDataOnSimObjectTypeThe SimConnect_RequestDataOnSimObjectTypefunction is used to retrieve information about simulationobjects of a given type that are within a specified radius of theuser's aircraft, or for Mission System objects. SyntaxHRESULT SimConnect_RequestDataOnSimObjectType( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possiblevalues include, but are not limited to, those in the following table.
ExampleSee SimConnect_AddToDataDefinitionfor an example of when to use this function Reference Samples
RemarksThe data will be returned on all the relevant objects withinthe specified radius, but they will not be returned in any specificorder. It is the responsibility of the client program to sort thereturned data into order, if that is required. Information is returned in a SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE structure,one structure per object.
Also refer to the note on multiplayer mode in the remarks for SimConnect_RequestDataOnSimObject.
If requesting data for SIMCONNECT_SIMOBJECT_TYPE_ALL_CRAFT, no Mission System data will be returned. To get a list of all mission objects, explicitly pass a value of SIMCONNECT_SIMOBJECT_TYPE_MISSION. See Also
SimConnect_RequestNotificationGroupThe SimConnect_RequestNotificationGroup function is used to request events are transmitted from a notification group, when the simulation is in Dialog Mode. SyntaxHRESULT SimConnect_RequestNotificationGroup( ParametershSimConnect Flags Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksIn this version this function has the specific purpose of enabling the sending of events, particularly joystick events, when the simulation is in Dialog Mode. See Also
SimConnect_RequestReservedKeyThe SimConnect_RequestReservedKey function is used to request a specific keyboard TAB-key combination applies only to this client. SyntaxHRESULT SimConnect_RequestReservedKey( ParametershSimConnect szKeyChoice2 Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Sample
RemarksA successful call to this function will result in a SIMCONNECT_RECV_RESERVED_KEY structure being returned, with the key that has been assigned to this client. The first of the three that can be assigned will be the choice, unless all three are already taken, in which case a null string will be returned.
The szKeyChoice parameters should be a single character (such as "A"), which is requesting that the key combination TAB-A is reserved for this client. All reserved keys are TAB-key combinations. See AlsoSimConnect_RequestSystemStateThe SimConnect_RequestSystemState function is used to request information from a number of Flight Sim World system components.SyntaxHRESULT SimConnect_RequestSystemState(
ParametershSimConnect
Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksThe information requested will be returned in a SIMCONNECT_RECV_SYSTEM_STATE structure.See AlsoSimConnect_SceneryCreateObjectThe SimConnect_SceneryCreateObject function is used to create a single, static scenery object from appropriate XML.SyntaxHRESULT SimConnect_SceneryCreateObject(
ParametershSimConnect
<SceneryObjects.LibraryObject> <WorldPosition>N48* 30.15',W123* 0.66',+000000.00</WorldPosition> <AltitudeIsAGL>True</AltitudeIsAGL> <Orientation>0.000, 0.000, 0.000</Orientation> <Scale>1.000</Scale> <ImageComplexity>Very Sparse</ImageComplexity> <MDLGuid>{3EBEDF9F-F072-11D2-9C84-00105A0CE62A}</MDLGuid></SceneryObjects.LibraryObject>
Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Samples
RemarksThe information requested will be returned in a SIMCONNECT_RECV_ASSIGNED_OBJECT_ID structure.See AlsoSimConnect_SceneryRemoveObjectThe SimConnect_SceneryRemoveObject function is used to remove a previously-created static scenery object.SyntaxHRESULT SimConnect_SceneryRemoveObject(
ParametershSimConnect
Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Samples
RemarksScenery objects are not removed when a flight ends, they should be explicitly removed by the client when it closes.See AlsoSimConnect_SceneryMoveObjectThe SimConnect_SceneryMoveObject function is used to reposition a previously-created static scenery object.SyntaxHRESULT SimConnect_SceneryMoveObject(
ParametershSimConnect
Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Samples
RemarksIn general, use an AI object for moving scenery items. This call is intended for infrequent repositioning of static scenery elements.See AlsoSimConnect_SceneryDetectObjectThe SimConnect_SceneryDetectObject function is used to find a previously-created static scenery object, or the terrain latitude/longitude, at the pixel position given.SyntaxHRESULT SimConnect_SceneryDetectObject(
ParametershSimConnect
Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Samples
RemarksPassing in coordinates of -1, -1 will be taken as meaning the center of the simulator window. The function returns a SIMCONNECT_RECV_OBJECT_AT_POINT structure. See AlsoSimConnect_SetClientDataThe SimConnect_SetClientData function is used to write one or more units of data to a client data area. SyntaxHRESULT SimConnect_SetClientData( ParametershSimConnect
Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksA data definition must be specified, using the SimConnect_AddToClientDataDefinition function, before data can be set. See Also
SimConnect_SetDataOnSimObjectThe SimConnect_SetDataOnSimObject function is used to make changes to the data properties of an object. SyntaxHRESULT SimConnect_SetDataOnSimObject( ParametershSimConnect
[in] Pointer to the data that is to be written. If the data is not in tagged format, this should point to the block of data. If the data is in tagged format this should point to the first tag name (datumID), which is always four bytes long, which should be followed by the data itself. Any number of tag name/value pairs can be specified this way, the server will use the cbUnitSize parameter to determine how much data has been sent. Return ValuesThe function returns an HRESULT. Possiblevalues include, but are not limited to, those in the following table.
Examplestatic enum DATA_DEFINE_ID { Reference Samples
RemarksThe data that is set on an object is defined in a data definition (see the SimConnect_AddToDataDefinition function). This data can include the following structures: SIMCONNECT_DATA_WAYPOINT, SIMCONNECT_DATA_INITPOSITION, and SIMCONNECT_DATA_MARKERSTATE. Any number of waypoints can be given to an AI object using a single call to this function, and any number of marker state structures can also be combined into an array.
The Simulation Variables document includes a column indicating whether variables can be written to or not. An exception will be returned if an attempt is made to write to a variable that cannot be set in this way. See Also
SimConnect_SetInputGroupPriorityThe SimConnect_SetInputGroupPriority functionis used to set the priority for a specified input group object. SyntaxHRESULT SimConnect_SetInputGroupPriority( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possiblevalues include, but are not limited to, those in the following table.
Examplehr=SimConnect_SetInputGroupPriority(hSimConnect,INPUT0,SIMCONNECT_GROUP_PRIORITY_HIGHEST); Reference Samples
RemarksA priority setting must be made for all input groups,otherwise event notifications will not be sent by the SimConnect server. See Also
SimConnect_SetInputGroupStateThe SimConnect_SetInputGroupState function isused to turn requests for input event information from theserver on and off. SyntaxHRESULT SimConnect_SetInputGroupState( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possiblevalues include, but are not limited to, those in the following table.
Examplestatic enum INPUT_ID { Reference Samples
RemarksThe default state for input groups is to be inactive, somakesure to call this function each time an input group is to becomeactive. See Also
SimConnect_SetNotificationGroupPriorityThe SimConnect_SetNotificationGroupPriority function is used to set the priority for a notification group. SyntaxHRESULT SimConnect_SetNotificationGroupPriority( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Examplehr=SimConnect_SetNotificationGroupPriority(hSimConnect,GROUP0,SIMCONNECT_GROUP_PRIORITY_HIGHEST); Reference Samples
RemarksSimConnect PrioritiesSimConnect constants define the following priorities:
Each notification group has an assigned priority, and the SimConnect server will send events out strictly in the order of priority. No two groups will be set at the same priority. If a request is received for a group to be set at a priority that has already been taken, the group will be assigned the next lowest priority that is available. This includes groups from all the clients that have opened communications with the server.
A typical use of masking is to prevent Flight Sim World itself from receiving an event, in order for the SimConnect client to completely replace the functionality in this case. Another use of masking is with co-operative clients, where there are multiple versions (perhaps a deluxe and standard version, or later and earlier versions), where the deluxe or later version might need to mask events from the other client, if they are both up and running. Flight Sim World does not mask any events. See Also
SimConnect_SetSystemEventStateThe SimConnect_SetSystemEventState function is used to turn requests for event information from the server on and off. SyntaxHRESULT SimConnect_SetSystemEventState( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
ExampleSee the example and reference samples for SimConnect_SubscribeToSystemEvent. RemarksIf this function is not called, the default is for the state to be on. This is different from input events, which have a default state of off.
Use this function to turn system events temporarily on and off, rather than make multiple calls to SimConnect_SubscribeToSystemEvent and SimConnect_UnsubscribeFromSystemEvent, which is less efficient. See AlsoSimConnect_SetSystemStateThe SimConnect_SetSystemState function is used to access a number of Flight Sim World system components.SyntaxHRESULT SimConnect_SetSystemState(
ParametershSimConnect
dwInteger fFloat Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Samples
RemarksThe integer, float and string set with this function match those in the SIMCONNECT_RECV_SYSTEM_STATE structure (which is returned if the information is requested with the SimConnect_RequestSystemState call. See AlsoSimConnect_SubscribeToSystemEventThe SimConnect_SubscribeToSystemEventfunction is used to request that a specific system event is notified tothe client. SyntaxHRESULT SimConnect_SubscribeToSystemEvent( ParametershSimConnect
Return ValuesThe function returns an HRESULT. Possiblevalues include, but are not limited to, those in the following table.
Example
Reference Samples
RemarksA single call to this function is all that is necessary to receive the notifications. For greatest efficiency use SimConnect_SetSystemEventState to turn these requests on and off temporarily, and call SimConnect_UnsubscribeFromSystemEvent once only to permanently terminate the notifications of these events. See AlsoSimConnect_TransmitClientEventThe SimConnect_TransmitClientEvent function is used to request that the Flight Sim World server transmit to all SimConnect clients the specified client event. SyntaxHRESULT SimConnect_TransmitClientEvent( ParametershSimConnect
Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Examples Reference Sample
RemarksTypically use this function to transmit an event to other SimConnect clients, including the simulation engine, although the client that transmits the event can also receive it. The order in which client notification groups are informed of the event is determined by the priority of each group. The higher the priority of the group, the earlier it will receive the event notification. Refer to the explanation of the maskable parameter for the SimConnect_AddClientEventToNotificationGroup call, which describes when the event may be masked and not transmitted to lower priority groups. Also see the explanation of SimConnect Priorities. See AlsoSimConnect_UnsubscribeFromSystemEventThe SimConnect_UnsubscribeFromSystemEventfunction is used to request that notifications are no longer receivedfor the specified system event. SyntaxHRESULT SimConnect_UnsubscribeFromSystemEvent( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possiblevalues include, but are not limited to, those in the following table.
Example
RemarksThere is no limit to the number of system events that can be subscribed to, but use this function to improve performance when a system event notification is no longer needed. See AlsoHelper FunctionsSimConnect_InsertStringThe SimConnect_InsertString function is used to assist in adding variable length strings to a structure. SyntaxHRESULT SimConnect_InsertString( ParameterspDest Return ValuesThe function returns an HRESULT. Possiblevalues include, but are not limited to, those in the following table.
RemarksThis function does not communicate with the SimConnect server, but is a helper function to assist in the handling of variable length strings. Its counterpart is the SimConnect_RetrieveString function. See AlsoSimConnect_RequestResponseTimesThe SimConnect_RequestResponseTimes function is used to provide some data on the performance of the client-server connection. SyntaxHRESULT SimConnect_RequestResponseTimes( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Example int quit = 0; RemarksThis function should not be used as part of a final application, as it is costly in performance, but is available to help provide some performance data that can be used while building an testing a client application. See AlsoSimConnect_RetrieveStringThe SimConnect_RetrieveString function is used to assist in retrieving variable length strings from a structure. SyntaxHRESULT SimConnect_RetrieveString( ParameterspData Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Example struct StructVS { Reference Sample
RemarksThis function does not communicate with the SimConnect server, but is a helper function to assist in the handling of variable length strings. Its counterpart is the SimConnect_InsertString function. Note that this function works in the case where an empty string is in the structure returned by the server. See AlsoAI Object Specific FunctionsSimConnect_AICreateEnrouteATCAircraftThe SimConnect_AICreateEnrouteATCAircraft function is used to create an AI controlled aircraft that is about to start or is already underway on its flight plan. SyntaxHRESULT SimConnect_AICreateEnrouteATCAircraft( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Sample
RemarksAn enroute aircraft can be on the ground or airborne when it is created by this function. Typically this will be an aircraft flying under IFR rules, and in constant radio contact with ATC. A number of errors, including SIMCONNECT_EXCEPTION_CREATE_AIRCRAFT_FAILED, apply to AI objects (refer to the SIMCONNECT_EXCEPTION enum for more details).
A SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE event notification can be subscribed to (see the SimConnect_SubscribeToSystemEvent function), which will return a SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE structure whenever any client, including the one making the change, successfully adds or removes an AI controlled object.
This function should be used for fixed-wing aircraft flying between airports on land. There is no internal AI pilot for helicopters, gliders or hot-air balloons. In order to add a helicopter, glider or balloon not controlled by the user, the SimConnect client must implement full control of the aircraft. Set up these objects with a call to SimConnect_AICreateSimulatedObject.
For float-planes the recommended procedure is to control them using waypoints, and not the ATC system, as there is no concept of a "parking space" after a water landing. So, the waypoints of the route of the float-plane should include the route that it should follow before take off and after landing. For all these cases of controlling aircraft using the client, or using waypoints, set up the object using the SimConnect_AICreateNonATCAircraft call. The Reality Bubble In order to improve performance, only a certain area around the user's aircraft is actually simulated at any one time. As the user flies the aircraft that area (referred to in the simulator as the "reality bubble") moves along with the aircraft. Simulated objects outside of the area are removed altogether, and new AI aircraft are not created if they fall outside these bounds. The reality bubble is in fact more of a box, and is aligned to lines of latitude and longitude, so the box becomes narrower near the poles than it is as the equator. The following diagram shows how the reality bubble works. There are always nine boxes (approximately 64Km square at the equator) that are simulated, and the user aircraft is always in the center box. As the aircraft flies over a boundary line, then the areas that are simulated change. In the following diagram, the green areas are simulated (active aircraft, airports, ground vehicles, shipping traffic and so on), and the grey areas are not.
Note that if an aircraft, or other simulation object, falls outside this area and is deleted by the system, the client will no longer receive information on the object (typically requested by the SimConnect_RequestDataOnSimObject function). Consider using the SimConnect_SubscribeToSystemEvent function to request notifications for "ObjectRemoved" to test for these situations. No automatic notification is given when information is requested on an object, and then subsequently that object is removed. Aircraft Flight Plans The following table contains an example flight plan from Sea-Tac International airport (KSEA) to San Francisco International airport (KSFO), following high-altitude airways. There are six waypoints, including the departure and destination airports. A flight plan can be created by Flight Sim World or created directly in XML, matching the required format. The simplest flight plan will contain only the departure and destination airports.
See Also
SimConnect_AICreateNonATCAircraftThe SimConnect_AICreateNonATCAircraft function is used to create an aircraft that is not flying under ATC control (so is typically flying under VFR rules). SyntaxHRESULT SimConnect_AICreateNonATCAircraft( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Sample
RemarksA non-ATC aircraft can be on the ground or airborne when it is created by this function. A number of errors, including SIMCONNECT_EXCEPTION_CREATE_AIRCRAFT_FAILED, apply to AI objects (refer to the SIMCONNECT_EXCEPTION enum for more details).
Refer to the remarks for SimConnect_AICreateEnrouteATCAircraft. See Also
SimConnect_AICreateParkedATCAircraftThe SimConnect_AICreateParkedATCAircraft function is used to create an AI controlled aircraft that is currently parked and does not have a flight plan. SyntaxHRESULT SimConnect_AICreateParkedATCAircraft( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Sample
RemarksCalling this function is no guarantee that there is sufficient parking space at the specified airport. An error will be returned if there is insufficient parking space, and an aircraft will not be created. A number of errors, including SIMCONNECT_EXCEPTION_CREATE_AIRCRAFT_FAILED, apply to AI objects (refer to the SIMCONNECT_EXCEPTION enum for more details). After creating an aircraft with this function, a call to SimConnect_AISetAircraftFlightPlan will set the aircraft in motion.
When allocating a parking space to an aircraft, the simulation uses a radius based on half the wingspan defined in the [aircraft_geometry] section of the Aircraft Configuration File.
Refer also to the remarks for SimConnect_AICreateEnrouteATCAircraft. See Also
SimConnect_AICreateSimulatedObjectThe SimConnect_AICreateSimulatedObject function is used to create AI controlled objects other than aircraft. SyntaxHRESULT SimConnect_AICreateSimulatedObject( ParametershSimConnect
Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Sample
RemarksThis function can be used to create a stationary aircraft (such as an unflyable aircraft on display outside a flight museum), but is typically intended to create simulation objects other than aircraft (such as ground vehicles, boats, and a number of special objects such as humpback whales and hot-air balloons). A number of errors apply to AI objects (refer to the SIMCONNECT_EXCEPTION enum for more details). See Also
SimConnect_AIReleaseControlThe SimConnect_AIReleaseControl function is used to clear the AI control of a simulated object, typically an aircraft, in order for it to be controlled by a SimConnect client. SyntaxHRESULT SimConnect_AIReleaseControl( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksThis function should be used to transfer the control of an aircraft, or other object, from the AI system to the SimConnect client. If this is not done the AI system and client may fight each other with unpredictable results. To prevent the simulation engine from updating the latitude, longitude, altitude and attitude of an aircraft, refer to the range of KEY_FREEZE..... Event IDs.
The object ID can be obtained in a number of ways, refer to the SimConnect_RequestDataOnSimObjectType call, and also the use of the SIMCONNECT_RECV_ASSIGNED_OBJECT_ID structure. See Also
SimConnect_AIRemoveObjectThe SimConnect_AIRemoveObject function is used to remove any object created by the client using one of the AI creation functions. SyntaxHRESULT SimConnect_AIRemoveObject( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksA client application can only remove AI controlled objects that it created, not objects created by other clients, or by the simulation itself. See Also
SimConnect_AISetAircraftFlightPlanThe SimConnect_AISetAircraftFlightPlan function is used to set or change the flight plan of an AI controlled aircraft. SyntaxHRESULT SimConnect_AISetAircraftFlightPlan( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Sample
RemarksA number of errors, including SIMCONNECT_EXCEPTION_CREATE_FLIGHTPLAN_FAILED, apply to AI objects (refer to the SIMCONNECT_EXCEPTION enum for more details).
Typically this function would be used some time after the aircraft was created using the SimConnect_AICreateParkedATCAircraft call. See Also
Camera Specific FunctionsSimConnect_CameraSetRelative6DOFThe SimConnect_CameraSetRelative6DOF function is used to adjust the user's aircraft view camera. SyntaxHRESULT SimConnect_CameraSetRelative6DOF( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Sample
RemarksAny one of the six parameters can be set to SIMCONNECT_CAMERA_IGNORE_FIELD which indicates that the value for the camera should be taken unmodified from the reference point. See Also
SimConnect_CameraGetCurrentViewThe SimConnect_CameraGetCurrentView function is used to fetch details of the user's aircraft view camera. SyntaxHRESULT SimConnect_CameraGetCurrentView( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
RemarksThe function returns an SIMCONNECT_RECV_CAMERA_VIEW structure. See Also
SimConnect_CameraRemoveThe SimConnect_CameraRemove function is used to delete a camera created with SimConnect_CameraSetCurrentView. SyntaxHRESULT SimConnect_CameraRemove( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
See Also
SimConnect_CameraSetCurrentViewThe SimConnect_CameraSetCurrentView function is used to set the current camera view according to the supplied details. SyntaxHRESULT SimConnect_CameraSetCurrentView( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
See AlsoFacilities Specific FunctionsSimConnect_RequestFacilitiesListThe SimConnect_RequestFacilitiesList function is used to request a list of all the facilities of a given type currently held in the facilities cache. SyntaxHRESULT SimConnect_RequestFacilitiesList( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Sample
RemarksThe simulation keeps a facilities cache of all the airports, waypoints, NDB and VOR stations within a certain radius of the user aircraft. This radius varies depending on where the aircraft is in the world, but is at least large enough to encompass the whole of the reality bubble for airports and waypoints, and can be over 200 miles for VOR and NDB stations. As the user aircraft moves facilities will be added to, and removed from, the cache. However, in the interests pf performance, hysteresis is built into the system.
To receive event notifications when a facility is added, use the SimConnect_SubscribeToFacilities function. When this function is first called, a full list from the cache will be sent, thereafter just the additions will be transmitted. No notification is given when a facility is removed from the cache. the Obviously to terminate these notifications use the SimConnect_UnsubscribeToFacilities function.
When requesting types of facility information, one function call has to be made for each of the four types of data. The data will be returned in one of the four structures:
The four list structures inherit the data from the SIMCONNECT_RECV_FACILITIES_LIST structure. Given that the list of returned facilities could be large, it may be split across several packets, and each packet must be interpreted separately by the client. See AlsoSimConnect_SubscribeToFacilitiesThe SimConnect_SubscribeToFacilities function is used to request notifications when a facility of a certain type is added to the facilities cache. SyntaxHRESULT SimConnect_SubscribeToFacilities( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Sample
RemarksSee the remarks for SimConnect_RequestFacilitiesList. See AlsoSimConnect_UnsubscribeToFacilitiesThe SimConnect_UnsubscribeToFacilities function is used to request that notifications of additions to the facilities cache are not longer sent. SyntaxHRESULT SimConnect_UnsubscribeToFacilities( ParametershSimConnect Return ValuesThe function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Reference Sample
RemarksSee the remarks for SimConnect_RequestFacilitiesList. See AlsoMenu Specific Functions |
Return value | Description |
S_OK | The function succeeded. |
E_FAIL | The function failed. |
Reference Sample
Primary sample |
Remarks
The menu item will be added to the Add-ons menu. The Add-ons menu will only appear if there is at least one menu entry. Sub-menu items can be associated with this menu item, see SimConnect_MenuAddSubItem. If the text for the menu item should change, then remove the menu item first before adding the menu item with the correct text (see SimConnect_MenuDeleteItem).
Each client can add a number of main menu items.
See Also
SimConnect_MenuAddSubItem
The SimConnect_MenuAddSubItem function is used to add a sub-menu item, associated with a client event.
Syntax
HRESULT SimConnect_MenuAddSubItem(
HANDLE hSimConnect,
SIMCONNECT_CLIENT_EVENT_ID MenuEventID,
const char* szMenuItem,
SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID,
DWORD dwData
);
Parameters
hSimConnect[in] Handle to a SimConnect object.
EventID
[in] Specifies the client defined menu event ID. This is the ID of the menu item that this item should be added to.
szMenuItem
[in] Null-terminated string containing the text for the sub-menu item.
EventID
[in] Specifies the client defined sub-menu event ID, which is to be transmitted when the sub-menu item is selected (in the uEventID parameter of the SIMCONNECT_RECV_EVENT structure). This ID must be unique across all sub-menu items for the client.
dwData
[in] Double word containing a data value that the client can specify for its own use (it will be returned in the dwData parameter of the SIMCONNECT_RECV_EVENT structure.
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. |
Remarks
A maximum of 16 sub-menu items may be added to any one main menu item. Sub-menu items are always added to the end of the sub-menu item list. An exception, SIMCONNECT_EXCEPTION_TOO_MANY_OBJECTS, will be returned if an attempt is made to add more than 16 sub-menu items.
See Also
SimConnect_MenuDeleteItem
The SimConnect_MenuDeleteItem function is used to remove a client defined menu item.
Syntax
HRESULT SimConnect_MenuDeleteItem(
HANDLE hSimConnect,
const SIMCONNECT_CLIENT_EVENT_ID MenuEventID
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
MenuEventID
[in] Specifies the client defined event ID.
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. |
Reference Sample
Primary sample |
Remarks
Menu items should be removed before a client closes. Removing the main menu item will remove any associated sub-menu items. Also see the remarks for SimConnect_MenuAddItem.
See Also
SimConnect_MenuDeleteSubItem
The SimConnect_MenuDeleteSubItem function is used to remove a specified sub-menu item.
Syntax
HRESULT SimConnect_MenuDeleteSubItem(
HANDLE hSimConnect,
SIMCONNECT_CLIENT_EVENT_ID MenuEventID,
const SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID
);
Parameters
hSimConnect[in] Handle to a SimConnect object.
MenuEventID
[in] Specifies the client defined menu event ID, from which the sub-menu item is to be removed.
SubMenuEventID
[in] Specifies the client defined sub-menu event ID.
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. |
Remarks
If a sub-menu item is deleted from the middle of the sub-menu item list, the list will contract.
See Also
SimConnect_Text
The SimConnect_Text function is used to display a text menu, or scrolling or static text, on the screen.
Syntax
HRESULT SimConnect_Text(
HANDLE hSimConnect,
SIMCONNECT_TEXT_TYPE type,
float fTimeSeconds,
SIMCONNECT_CLIENT_EVENT_ID EventID,
DWORD cbUnitSize,
void* pDataSet
);
Parameters
hSimConnect[in] Handle to a SimConnect object.
type
[in] One member of the SIMCONNECT_TEXT_TYPE enumeration type.
fTimeSeconds
[in] The timeout value for the text or menu, in seconds. If zero is entered, the text or menu will not timeout. For text only, this timeout value can be overridden if there are other text requests waiting in the queue (see the Remarks below). If the timeout requested exceeds the minimum display time, and another text request is waiting, the timeout value is overridden and the text will only be displayed for the minimum display time. The default minimum display time is two seconds for static text and 10 seconds for scrolling text. These can be changed in the [SimConnect] section of FSW.cfg file using the TextMinPrintTimeSeconds and TextMinScrollTimeSeconds settings.
EventID
[in] Specifies the client defined event ID, which will be returned along with the SIMCONNECT_TEXT_RESULT (in the dwData parameter) of a SIMCONNECT_RECV_EVENT structure.
cbUnitSize
[in] Specifies the size of pDataSet in bytes.
pDataSet
[in] Specifies the array of string data for the menu or text. For text simply enter the string, for a menu the format of the string is a list of null-terminated string entries, with the menu title and prompt as the first two entries, for example: "Title\0Prompt\0Menu item 1\0Menu item 2\0", with a maximum of ten menu items. If an empty string is sent in pDataSet along with an EventID that matches a menu or text in the queue (see Remarks below), that entry will be removed from the queue, with the SIMCONNECT_TEXT_RESULT_REMOVED event being returned to the client. If a new set of menu items, or new text string, is sent with an EventID that matches an entry in the queue, that entry will be replaced in the queue, with the SIMCONNECT_TEXT_RESULT_REPLACED event being returned to the client. The entry will not lose its place in the queue. This change will take place even if the text or menu is being rendered on the screen.
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. |
Reference Sample
Primary samples |
Remarks
Only one text and one menu request can appear on the screen at one time. Requests are queued as they are received, with only the topmost in the queue being displayed. There is one queue for menus and another for static and scrolling text. When a request is first displayed the SIMCONNECT_TEXT_RESULT_DISPLAYED event will be sent to the client. If a request joins the queue and cannot immediately be displayed the event SIMCONNECT_TEXT_RESULT_QUEUED will be sent. When it is the turn of the new request to be displayed the SIMCONNECT_TEXT_RESULT_DISPLAYED event will be sent. If the request is for a menu, and the user selects one of the menu entries, one of the SIMCONNECT_TEXT_RESULT_MENU_SELECT_N events will be returned (see the SIMCONNECT_TEXT_RESULT enumeration), and the menu closed.
The default location for static or scrolling text is along the top of the screen. A user can move and resize the window that the text is being displayed in, but it is not possible to specify an alternative location for the text programmatically.
See Also
Mission Specific Functions
SimConnect_CompleteCustomMissionAction
The SimConnect_CompleteCustomMissionAction function is used to complete the mission action specified by a GUID.
Syntax
HRESULT SimConnect_CompleteCustomMissionAction(
HANDLE hSimConnect,
const GUID guidInstanceId
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
guidInstanceId
[in] GUID of the custom action. The GUID should be found in the associated mission xml file.
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. |
Reference Sample
Primary sample | Mission Action |
Remarks
A mission is specified in an xml file. A custom action is defined within this xml file, and will look similar to the following:
<SimMission.CustomAction InstanceId="{ GUID }"> <PayLoadString>Any string goes here!</PayLoadString> <WaitForCompletion>True</WaitForCompletion> </SimMission.CustomAction> |
Custom actions provide a mechanism to add complex processing to the basically data-driven mission system.
The custom action would typically be triggered from within the mission xml file (a trigger referencing the GUID of the custom action), though it could be called from within the SimConnect client with a call to SimConnect_ExecuteMissionAction. It is only necessary to call SimConnect_CompleteCustomMissionAction if the WaitForCompletion value is set to True.
If the client calls SimConnect_ExecuteMissionAction from within the code for a custom action, and it is important that this action completes before any other actions are started (that is, WaitForCompletion is True) then a second custom action should be defined that calls SimConnect_CompleteCustomMissionAction after that action is complete, and with the GUID of the first custom action as its parameter. The reference sample shows this process.
In order to received notifications that a custom action is to be executed, the SimConnect client should use the SimConnect_SubscribeToSystemEvent call with the SystemEventName parameter set to "CustomMissionActionExecuted". This will result in the GUID of the custom action, and the PayLoadString, being sent to the client in a SIMCONNECT_RECV_CUSTOM_ACTION structure.
If a mission requires additional processing on its completion the SimConnect client should use the SimConnect_SubscribeToSystemEvent call with the SystemEventName parameter set to "MissionCompleted".
See Also
SimConnect_ExecuteMissionAction
The SimConnect_ExecuteMissionAction function is used to execute the mission action specified by a GUID.
Syntax
HRESULT SimConnect_ExecuteMissionAction(
HANDLE hSimConnect,
const GUID guidInstanceId
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
guidInstanceId
[in] GUID of the Mission Action. The GUID should be found in the associated mission xml file.
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. |
Reference Sample
Primary sample | Mission Action |
Remarks
A mission is specified in an xml file.
In order to use SimConnect_ExecuteMissionAction, typically there should be at least one custom action within the mission xml file. The custom action will initiate the sending of a notification to the SimConnect client, and the client can then both do some processing of its own and run, by calling SimConnect_ExecuteMissionAction, one or more actions (spoken text, for example) that are defined within the xml file.
See the remarks for SimConnect_CompleteCustomMissionAction.
See Also
- SimConnect_CompleteCustomMissionAction
- SIMCONNECT_RECV_CUSTOM_ACTION
- SimConnect_SubscribeToSystemEvent
- SimConnect API Reference
Audio Specific Functions
SimConnect_VoiceCreate
The SimConnect_VoiceCreate function creates a new voice in the appropriate subgroup.
Syntax
HRESULT SimConnect_VoiceCreate(
HANDLE hSimConnect,
UINT16 index,
UINT16 subGroup,
BOOL is3d
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index (0-127).
subGroup
[in] The subgroup for the voice (see notes).
is3d
[in] TRUE if the voice has a 3D position.
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. |
Remarks
A maximum of 128 voices can be created. The sound group can be one of the following:
Number | Description |
1 | Engine sounds |
2 | Cockpit sounds |
3 | Environmental sounds |
4 | Voice sounds |
5 | Music |
6 | UI sounds |
See Also
SimConnect_QueueWaveOnVoice
The SimConnect_QueueWaveOnVoice function queues a WAV file, specified by a filename, on a voice.
Syntax
HRESULT SimConnect_QueueWaveOnVoice(
HANDLE hSimConnect,
UINT16 index,
DWORD cbUnitSize,
void * pDataSet
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
cbUnitSize
[in] Length of filename string including trailing zero.
pDataSet
[in] Pointer to filename 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. |
Remarks
The queued data does not play automatically.
See Also
SimConnect_QueueWaveDataOnVoice
The SimConnect_QueueWaveDataOnVoice function queues wave data on a voice. The format expected is the same as a standard .WAV file.
Syntax
HRESULT SimConnect_QueueWaveDataOnVoice(
HANDLE hSimConnect,
UINT16 index,
DWORD cbUnitSize,
void * pDataSet
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
cbUnitSize
[in] Length of wave data.
pDataSet
[in] Pointer to data.
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. |
Remarks
The queued data does not play automatically.
See Also
SimConnect_PlayVoice
The SimConnect_PlayVoice function starts playing any queued data for a voice.
Syntax
HRESULT SimConnect_PlayVoice(
HANDLE hSimConnect,
UINT16 index
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
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. |
Remarks
None.
See Also
SimConnect_StopVoice
The SimConnect_StopVoice function stops a voice playing.
Syntax
HRESULT SimConnect_StopVoice(
HANDLE hSimConnect,
UINT16 index
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
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. |
Remarks
None.
See Also
SimConnect_SetVoiceLooping
The SimConnect_SetVoiceLooping function enables or disables looping on a voice.
Syntax
HRESULT SimConnect_SetVoiceLooping(
HANDLE hSimConnect,
UINT16 index,
BOOL looping
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
looping
[in] TRUE if the voice should loop.
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. |
Remarks
None.
See Also
SimConnect_SetVoiceVolume
The SimConnect_SetVoiceVolume function sets the volume on a voice.
Syntax
HRESULT SimConnect_SetVoiceVolume(
HANDLE hSimConnect,
UINT16 index,
float vol
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
vol
[in] The volume in decibels.
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. |
Remarks
None.
See Also
SimConnect_SetVoiceVolumeMin
The SimConnect_SetVoiceVolumeMin function sets the minimum volume for a voice.
Syntax
HRESULT SimConnect_SetVoiceVolumeMin(
HANDLE hSimConnect,
UINT16 index,
float vol
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
vol
[in] The volume in decibels.
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. |
Remarks
None.
See Also
SimConnect_SetVoiceVolumeMax
The SimConnect_SetVoiceVolumeMax function sets the maximum volume for a voice.
Syntax
HRESULT SimConnect_SetVoiceVolumeMax(
HANDLE hSimConnect,
UINT16 index,
float vol
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
vol
[in] The volume in decibels.
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. |
Remarks
None.
See Also
SimConnect_SetVoicePitch
The SimConnect_SetVoicePitch function sets the pitch for a voice.
Syntax
HRESULT SimConnect_SetVoicePitch(
HANDLE hSimConnect,
UINT16 index,
float pitch
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
pitch
[in] Frequency change, expressed as source frequency / target frequency.
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. |
Remarks
None.
See Also
SimConnect_SetVoicePosition
The SimConnect_SetVoicePosition function sets the 3D position of a voice.
Syntax
HRESULT SimConnect_SetVoicePosition(
HANDLE hSimConnect,
UINT16 index,
float x, y, z,
BOOL userCentered
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
x, y, z
[in] The position.
userCentered
[in] TRUE if the position is relative to the user's aircraft.
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. |
Remarks
Needs to be called every frame.
See Also
SimConnect_SetVoiceVelocity
The SimConnect_SetVoiceVelocity function sets the 3D velocity of a voice.
Syntax
HRESULT SimConnect_SetVoiceVelocity(
HANDLE hSimConnect,
UINT16 index,
float x, y, z,
BOOL userCentered
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
x, y, z
[in] The velocity.
userCentered
[in] TRUE if the velocity is relative to the user's aircraft.
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. |
Remarks
Needs to be called every frame.
See Also
SimConnect_SetVoiceConeOrientation
The SimConnect_SetVoiceConeOrientation function sets the orientation of the voice's cone (if used).
Syntax
HRESULT SimConnect_SetVoiceConeOrientation(
HANDLE hSimConnect,
UINT16 index,
float x, y, z,
BOOL userCentered
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
x, y, z
[in] Orientation as a normalized vector.
userCentered
[in] TRUE if the orientation is relative to the user's aircraft.
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. |
Remarks
Needs to be called every frame.
See Also
SimConnect_SetVoiceConeAngles
The SimConnect_SetVoiceConeAngles function sets inner and outer cone angles for a voice.
Syntax
HRESULT SimConnect_SetVoiceConeAngles(
HANDLE hSimConnect,
UINT16 index,
UINT16 inner,
UINT16 outer
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
inner
[in] The angle of the inner cone in degrees.
outer
[in] The angle of the outer cone in degrees.
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. |
Remarks
None.
See Also
SimConnect_SetVoiceConeOuterVol
The SimConnect_SetVoiceConeOuterVol function sets the volume for the outer cone.
Syntax
HRESULT SimConnect_SetVoiceConeOuterVol(
HANDLE hSimConnect,
UINT16 index,
float vol
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
vol
[in] Volume in decibels.
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. |
Remarks
None.
See Also
SimConnect_SetVoiceFlush
The SimConnect_SetVoiceFlush function stops the voice and clears all queued data.
Syntax
HRESULT SimConnect_SetVoiceFlush(
HANDLE hSimConnect,
UINT16 index
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
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. |
Remarks
None.
See Also
SimConnect_VoiceDestroy
The SimConnect_VoiceDestroy function destroys a voice.
Syntax
HRESULT SimConnect_VoiceDestroy(
HANDLE hSimConnect,
UINT16 index
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
index
[in] The voice index.
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. |
Remarks
None.
See Also
SimConnect_GetVoiceVolume
The SimConnect_GetVoiceVolume function is used to request the current volume for a voice.
Syntax
HRESULT SimConnect_GetVoiceVolume(
HANDLE hSimConnect,
SIMCONNECT_DATA_REQUEST_ID RequestID,
UINT16 index
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
RequestID
[in] Specifies the client defined request ID. This will be returned along with the data.
index
[in] The voice index.
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. |
Remarks
The function returns an SIMCONNECT_RECV_AUDIO_RESPONSE structure.
See Also
SimConnect_GetVoicePitch
The SimConnect_GetVoicePitch function is used to request the current pitch of a voice.
Syntax
HRESULT SimConnect_GetVoicePitch(
HANDLE hSimConnect,
SIMCONNECT_DATA_REQUEST_ID RequestID,
UINT16 index
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
RequestID
[in] Specifies the client defined request ID. This will be returned along with the data.
index
[in] The voice index.
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. |
Remarks
The function returns an SIMCONNECT_RECV_AUDIO_RESPONSE structure.
See Also
SimConnect_GetVoiceTimeRemaining
The SimConnect_GetVoiceTimeRemaining function is used to request the time remaining on a voice (in seconds).
Syntax
HRESULT SimConnect_GetVoiceTimeRemaining(
HANDLE hSimConnect,
SIMCONNECT_DATA_REQUEST_ID RequestID,
UINT16 index
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
RequestID
[in] Specifies the client defined request ID. This will be returned along with the data.
index
[in] The voice index.
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. |
Remarks
The function returns an SIMCONNECT_RECV_AUDIO_RESPONSE structure.
See Also
SimConnectStructures and Enumerations
SimConnect uses the following structures and enumerations.
Name | Structure or Enumeration | Description |
SIMCONNECT_CLIENT_DATA_PERIOD | Enum | Used with the SimConnect_RequestClientData call to specify how often data is to be sent to the client. |
SIMCONNECT_DATA_RACE_RESULT | Struct | Used to hold mutiplayer racing results. |
SIMCONNECT_DATATYPE | Enum | Used with the SimConnect_AddToDataDefinition call to specify the data type that the server should use to return the specified data to the client. |
SIMCONNECT_DATA_CAMERA_VIEW | Struct | Used to pass information on a camera view. |
SIMCONNECT_DATA_FACILITY_AIRPORT | Struct | Used to return information on a single airport in the facilities cache. |
SIMCONNECT_DATA_FACILITY_NDB | Struct | Used to return information on a single NDB station in the facilities cache. |
SIMCONNECT_DATA_FACILITY_VOR | Struct | Used to return information on a single VOR station in the facilities cache. |
SIMCONNECT_DATA_FACILITY_WAYPOINT | Struct | Used to return information on a single waypoint in the facilities cache. |
SIMCONNECT_DATA_INITPOSITION | Struct | Used to initialize the position of a the user or AI controlled aircraft. |
SIMCONNECT_DATA_LATLONALT | Struct | Used to hold a world position. |
SIMCONNECT_DATA_MARKERSTATE | Struct | Used to help graphically link flight model data with the graphics model. |
SIMCONNECT_DATA_WAYPOINT | Struct | Used to hold all the necessary information on a waypoint. |
SIMCONNECT_DATA_XYZ | Struct | Used to hold a 3D co-ordinate. |
SIMCONNECT_VERTEX3D | Struct | Used to define an array of points for simple line rendering. |
SIMCONNECT_EXCEPTION | Enum | Used with the SIMCONNECT_RECV_EXCEPTION structureto return information on an error that has occurred. |
SIMCONNECT_FACILITY_LIST_TYPE | Enum | Used to determine which type of facilities data is being requested or returned. |
SIMCONNECT_MISSION_END | Enum | Used to specify the three possible outcomes of a mission. |
SIMCONNECT_PERIOD | Enum | Used with the SimConnect_RequestDataOnSimObject call to specify how often data is to be sent to the client. |
SIMCONNECT_RECV | Struct | Used with the SIMCONNECT_RECV_IDenumeration to indicate which type of structure has been returned. |
SIMCONNECT_RECV_AIRPORT_LIST | Struct | Used to return a list of SIMCONNECT_DATA_FACILITY_AIRPORT structures. |
SIMCONNECT_RECV_AUDIO_RESPONSE | Struct | Used to return audio data. |
SIMCONNECT_RECV_ASSIGNED_OBJECT_ID | Struct | Used to return an object ID that matches a request ID. |
SIMCONNECT_RECV_CAMERA_VIEW | Struct | Will be received by the client after a successful call to SimConnect_CameraGetCurrentView. |
SIMCONNECT_RECV_CLIENT_DATA | Struct | Will be received by the client after a successfulcall to SimConnect_RequestClientData. The structure is identical to SIMCONNECT_RECV_SIMOBJECT_DATA. |
SIMCONNECT_RECV_CLOUD_STATE | Struct | Used to return an array of cloud state data. |
SIMCONNECT_RECV_CUSTOM_ACTION | Struct | Used specifically with the mission system, providing details on the custom action that has been triggered. |
SIMCONNECT_RECV_EVENT | Struct | Used to return an event ID to the client. |
SIMCONNECT_RECV_EVENT_FILENAME | Struct | Used with the SimConnect_SubscribeToSystemEvent to return a filename and an event ID to the client. |
SIMCONNECT_RECV_EVENT_FRAME | Struct | Used with the SimConnect_SubscribeToSystemEvent to return the frame rate and simulation speed to the client. |
SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED | Struct | Sent to a client when they have successfully joined a multi-player race. |
SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED | Struct | Sent to the host when the session is visible to other users in the lobby. |
SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED | Struct | Sent to a client when they have requested to leave a race, or to all players when the session is terminated by the host. |
SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE | Struct | Used to return the type and ID of an AI object that has been added or removed from the simulation, by any client. |
SIMCONNECT_RECV_EVENT_RACE_END | Struct | Used to hold the results for one player at the end of a race. |
SIMCONNECT_RECV_EVENT_RACE_LAP | Struct | Used to hold the results for one player at the end of a lap. |
SIMCONNECT_RECV_EXCEPTION | Struct | Used with the SIMCONNECT_EXCEPTIONenumeration type to return information on an error that has occurred. |
SIMCONNECT_RECV_FACILITIES_LIST | Struct | Used to provide information on the number of elements in a list of facilities returned to the client, and the number of packets that were used to transmit the data. |
SIMCONNECT_RECV_ID | Enum | Used within the SIMCONNECT_RECV structure to indicate which type of structure has beenreturned. |
SIMCONNECT_RECV_NDB_LIST | Struct | Used to return a list of SIMCONNECT_DATA_FACILITY_NDB structures. |
SIMCONNECT_RECV_OPEN | Struct | Used to return information to the client, after a successful call to SimConnect_Open. |
SIMCONNECT_RECV_QUIT | Struct | This is an identical structure to the SIMCONNECT_RECV structure. |
SIMCONNECT_RECV_RESERVED_KEY | Struct | Used with the SimConnect_RequestReservedKey function to return the reserved key combination. |
SIMCONNECT_RECV_SIMOBJECT_DATA | Struct | Will be received by the client after a successful callto SimConnect_RequestDataOnSimObject or SimConnect_RequestDataOnSimObjectType. |
SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE | Struct | Will be received by the client after a successfulcall to SimConnect_RequestDataOnSimObjectType. The structure is identical to SIMCONNECT_RECV_SIMOBJECT_DATA. |
SIMCONNECT_RECV_SYSTEM_STATE | Struct | Used with the SimConnect_RequestSystemState function to retrieve specific Flight Sim World systems states and information. |
SIMCONNECT_RECV_VOR_LIST | Struct | Used to return a list of SIMCONNECT_DATA_FACILITY_VOR structures. |
SIMCONNECT_RECV_WAYPOINT_LIST | Struct | Used to return a list of SIMCONNECT_DATA_FACILITY_WAYPOINT structures. |
SIMCONNECT_RECV_WEATHER_OBSERVATION | Struct | Used to return weather observation data, after calls to one of: SimConnect_WeatherRequestInterpolatedObservation, SimConnect_WeatherRequestObservationAtStation, or SimConnect_WeatherRequestObservationAtNearestStation. |
SIMCONNECT_SIMOBJECT_TYPE | Enum | Used with the SimConnect_RequestDataOnSimObjectTypecall to request information on specific or nearby objects. |
SIMCONNECT_STATE | Enum | Used with the SimConnect_SetSystemEventStatecall to turn the reporting of events on and off. |
SIMCONNECT_TEXT_RESULT | Enum | Used to specify which event has occurred as a result of a call to SimConnect_Text. |
SIMCONNECT_TEXT_TYPE | Enum | Used to specify which type of text is to be displayed by the SimConnect_Text function |
SIMCONNECT_WAYPOINT_FLAGS | Enum | Used with the SIMCONNECT_DATA_WAYPOINT structure to define waypoints. |
SIMCONNECT_WEATHER_MODE | Enum | Used to return the current weather mode, after a call using the SIMCONNECT_RECV_ID_EVENT_WEATHER_MODE setting. |
SIMCONNECT_CLIENT_DATA_PERIOD
The SIMCONNECT_CLIENT_DATA_PERIOD enumeration type is used with the SimConnect_RequestClientData call to specify how often data is to be sent to the client.
Syntax
enum SIMCONNECT_CLIENT_DATA_PERIOD{
SIMCONNECT_PERIOD_NEVER,
SIMCONNECT_PERIOD_ONCE,
SIMCONNECT_PERIOD_VISUAL_FRAME,
SIMCONNECT_PERIOD_ON_SET,
SIMCONNECT_PERIOD_SECOND,
};
Members
SIMCONNECT_PERIOD_NEVER
Specifies that the data is not to be sent.
SIMCONNECT_PERIOD_ONCE
Specifies that the data should be sent once only. Note that this is not an efficient way of receiving data frequently, use one of the other periods if there is a regular frequency to the data request.
SIMCONNECT_PERIOD_VISUAL_FRAME
Specifies that the data should be sent every visual (rendered) frame.
SIMCONNECT_PERIOD_ON_SET
Specifies that the data should be sent whenever it is set.
SIMCONNECT_PERIOD_SECOND
Specifies that the data should be sent once every second.
Remarks
Although the period definitions are specific, data is always transmitted at the end of a frame, so even if you have specified that data should be sent every second, the data will actually be transmitted at the end of the frame that comes on or after one second has elapsed.
See Also
SIMCONNECT_DATA_RACE_RESULT
The SIMCONNECT_DATA_RACE_RESULT structure is used to hold mutiplayer racing results.
Syntax
struct SIMCONNECT_DATA_RACE_RESULT{DWORD dwNumberOfRacers;
GUID MissionGUID;
char szPlayerName[MAX_PATH];
char szSessionType[MAX_PATH];
char szAircraft[MAX_PATH];
char szPlayerRole[MAX_PATH];
double fTotalTime;
double fPenaltyTime;
DWORD dwIsDisqualified;
};
Members
dwNumberOfRacers
The total number of racers.
MissionGUID
The GUID of the mission that has been selected by the host.
szPlayerName[MAX_PATH]
Null terminated string containing the name of the player.
szSessionType[MAX_PATH]
Null terminated string containing the type of the multiplayer session, currently one of: "LAN" or "GAMESPY".
szAircraft[MAX_PATH]
Null terminated string containing the aircraft type, which is the title field from the Aircraft Configuration File.
szPlayerRole[MAX_PATH]
Null terminated string containing the player's role (or name) in the mission. This string wil be filled from the Name property of the Player object in the mission file.
fTotalTime
If this structure is a member of a SIMCONNECT_RECV_EVENT_RACE_END structure, then this contains the final race time in seconds, or 0 for DNF (Did Not Finish). If this structure is a member of a SIMCONNECT_RECV_EVENT_RACE_LAP structure, then this contains the lap time in seconds.
fPenaltyTime
If this structure is a member of a SIMCONNECT_RECV_EVENT_RACE_END structure, then this contains the final penalty time in seconds. If this structure is a member of a SIMCONNECT_RECV_EVENT_RACE_LAP structure, then this contains the total penalty time in seconds received so far (not just for this lap).
dwIsDisqualified
A boolean value, 0 indicating the player has not been disqualified, non-zero indicating they have been disqualified.
Remarks
This structure is never sent on its own, but is always a member of either a SIMCONNECT_RECV_EVENT_RACE_END structure or a SIMCONNECT_RECV_EVENT_RACE_LAP structure.
See Also
SIMCONNECT_VERTEX3D
The SIMCONNECT_VERTEX3D structure is used to send an array of points for vector line rendering.
Syntax
struct SIMCONNECT_VERTEX3D {float xOffset;
float yOffset;
float zOffset;
BOOL LastInSegment;
DWORD colourARGB;
};
Members
xOffset, yOffset, zOffset
Offset from the shape's defined world position, in meters.
LastInSegment
If TRUE, this point will not have a line drawn between it and the next one.
colourARGB
The colour to be used for the line between this point and the previous one.
Remarks
See Also
SIMCONNECT_DATATYPE
The SIMCONNECT_DATATYPE enumeration type isused with the SimConnect_AddToDataDefinitioncall to specify the data type that the server should use to return the specified data to the client.
Syntax
enum SIMCONNECT_DATATYPE{
SIMCONNECT_DATATYPE_INVALID,
SIMCONNECT_DATATYPE_INT32,
SIMCONNECT_DATATYPE_INT64,
SIMCONNECT_DATATYPE_FLOAT32,
SIMCONNECT_DATATYPE_FLOAT64,
SIMCONNECT_DATATYPE_STRING8,
SIMCONNECT_DATATYPE_STRING32,
SIMCONNECT_DATATYPE_STRING64,
SIMCONNECT_DATATYPE_STRING128,
SIMCONNECT_DATATYPE_STRING256,
SIMCONNECT_DATATYPE_STRING260,
SIMCONNECT_DATATYPE_STRINGV,
SIMCONNECT_DATATYPE_INITPOSITION,
SIMCONNECT_DATATYPE_MARKERSTATE,
SIMCONNECT_DATATYPE_WAYPOINT,
SIMCONNECT_DATATYPE_LATLONALT,
SIMCONNECT_DATATYPE_XYZ,
SIMCONNECT_DATATYPE_MAX
};
Members
SIMCONNECT_DATATYPE_FLOAT32,64
Specifies a 32 bit or 64 bit floating point number.
SIMCONNECT_DATATYPE_STRING8,32,64,128,256,260
Specifies strings of the given length (8 characters to 260 characters)
SIMCONNECT_DATATYPE_STRINGV
Specifies a variable length string.
SIMCONNECT_DATATYPE_INITPOSITION
Specifies the SIMCONNECT_DATA_INITPOSITION structure.
SIMCONNECT_DATATYPE_MARKERSTATE
Specifies the SIMCONNECT_DATA_MARKERSTATE structure.
SIMCONNECT_DATATYPE_WAYPOINT
Specifies the SIMCONNECT_DATA_WAYPOINT structure.
SIMCONNECT_DATATYPE_LATLONALT
Specifies the SIMCONNECT_DATA_LATLONALT structure.
SIMCONNECT_DATATYPE_XYZ
Specifies the SIMCONNECT_DATA_XYZ structure.
Reference Samples
Primary samples |
Remarks
The three structures in the list of data types can only be used as input (using SimConnect_SetDataOnSimObject) and not to receive requested data.
See Also
SIMCONNECT_DATA_CAMERA_VIEW
The SIMCONNECT_DATA_CAMERA_VIEW structure is used to pass information on a camera view.
Syntax
struct SIMCONNECT_DATA_CAMERA_VIEW
{
GUID cameraDefinitionId;
char szCameraName[32];
SIMCONNECT_VIEW_SYSTEM_EVENT_DATA ViewType;
DWORD SourceObjectID;
SIMCONNECT_DATA_LATLONALT EyePosition;
double EyePosAGL;
DWORD TargetObjectID;
SIMCONNECT_DATA_LATLONALT TargetPosition;
double TargetPosAGL;
double OffsetPitch;
double OffsetBank;
double OffsetHeading;
double AbsPitch;
double AbsBank;
double AbsHeading;
SIMCONNECT_DATA_XYZ BiasOffset;
SIMCONNECT_DATA_XYZ TargetObjectOffset;
double Zoom;
BOOL IsCinematic;
BOOL IsInternal;
BOOL CanTransition;
BOOL PlayerSelectable;
};
Members
cameraDefinitionID
GUID of the camera concerned.
szCameraName
String containing the camera name.
ViewType
Bitfield value describing the type of camera (see SimConnect_SubscribeToSystemEvent).
SourceObjectID
Object the camera is attached to, can be SIMCONNECT_UNUSED, SIMCONNECT_OBJECT_ID_USER, or a game object id.
EyePosition
Latitude, Longitude, Altitude of the eyepoint.
EyePosAGL
Eyepoint altitude relative to ground level (get) or whether to treat the EyePosition altitude as AGL (set) if non-zero.
TargetObjectID
Object the camera is looking at, can be SIMCONNECT_UNUSED or a game object id.
TargetPosition
Latitude, Longitude, Altitude of the target point.
TargetPosAGL
Whether to treat the TargetPosition altitude as AGL (set) if non-zero.
OffsetPitch
Pitch angle of the view, including user adjusments.
OffsetBank
Bank angle of the view, including user adjusments.
OffsetHeading
Heading angle of the view, including user adjusments.
AbsPitch
Pitch angle of the view, without user adjusments.
AbsBank
Bank angle of the view, without user adjusments.
AbsHeading
Heading angle of the view, without user adjusments.
BiasOffset
XYZ offsets of the view from the eyepoint.
TargetObjectOffset
XYZ offsets of the target object (for cinematic mission cameras only).
IsCinematic
Is this a cinematic camera.
IsInternal
Is this an in-cockpit camera.
CanTransition
Can this camera transition.
PlayerSelectable
Can the player select this camera.
See Also
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_DATA_FACILITY_AIRPORT
The SIMCONNECT_DATA_FACILITY_AIRPORT structure is used to return information on a single airport in the facilities cache.
Syntax
struct SIMCONNECT_DATA_FACILITY_AIRPORT{
char Icao[9];
double Latitude;
double Longitude;
double Altitude;
};
Members
Icao[9]
ICAO of the facility.
Latitude
Latitude of the airport in facility.
Longitude
Longitude of the airport in facility.
Altitude
Altitude of the facility in meters.
Remarks
This structure is returned as one element in the SIMCONNECT_RECV_AIRPORT_LIST structure. Note that this structure is inherited by SIMCONNECT_DATA_FACILITY_WAYPOINT, SIMCONNECT_DATA_FACILITY_NDB and SIMCONNECT_DATA_FACILITY_VOR, so the latitude, longitude, and altitude will apply to those facilities in that case.
See the remarks for SimConnect_RequestFacilitiesList.
See Also
SIMCONNECT_DATA_FACILITY_NDB
The SIMCONNECT_DATA_FACILITY_NDB structure is used to return information on a single NDB station in the facilities cache.
Syntax
struct SIMCONNECT_DATA_FACILITY_NDB : public SIMCONNECT_DATA_FACILITY_WAYPOINT{
DWORD fFrequency;
};
Members
fFrequency
Frequency of the station in Hz.
Remarks
This structure is returned as one element in the SIMCONNECT_RECV_NDB_LIST structure. It inherits all the members of the SIMCONNECT_DATA_FACILITY_WAYPOINT structure.
See the remarks for SimConnect_RequestFacilitiesList.
See Also
- SIMCONNECT_DATA_FACILITY_AIRPORT
- SIMCONNECT_DATA_FACILITY_VOR
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_DATA_FACILITY_VOR
The SIMCONNECT_DATA_FACILITY_VOR structure is used to return information on a single VOR station in the facilities cache.
Syntax
struct SIMCONNECT_DATA_FACILITY_VOR: public SIMCONNECT_DATA_FACILITY_NDB{
DWORD Flags;
float fLocalizer;
double GlideLat;
double GlideLon;
double GlideAlt;
float fGlideSlopeAngle;
};
Members
Flags
Flags indicating whether the other fields are valid or not.
Flag | Value | Description |
SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL | 0x1 | Set if the station has a NAV transmitter, and if so, GlideLat, GlideLon and GlideAlt contain valid data. |
SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER | 0x2 | Set if the station transmits an ILS localizer angle, and if so fLocalizer contains valid data. |
SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE | 0x4 | Set if the station transmits an ILS approach angle, and if so fGlideSlopeAngle contains valid data. |
SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME | 0x8 | Set if the station t transmits a DME signal, and if so the inherited DME fFrequency contains valid data. |
fLocalizer
The ILS localizer angle in degrees.
GlideLat
The latitude of the glide slope transmitter in degrees.
GlideLon
The longitude of the glide slope transmitter in degrees.
GlideAlt
The altitude of the glide slope transmitter in degrees.
fGlideSlopeAngle
The ILS approach angle in degrees.
Remarks
This structure is returned as one element in the SIMCONNECT_RECV_VOR_LIST structure. It inherits all the members from SIMCONNECT_DATA_FACILITY_NDB.
See the remarks for SimConnect_RequestFacilitiesList.
See Also
- SIMCONNECT_DATA_FACILITY_AIRPORT
- SIMCONNECT_DATA_FACILITY_WAYPOINT
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_DATA_FACILITY_WAYPOINT
The SIMCONNECT_DATA_FACILITY_WAYPOINT structure used to return information on a single waypoint in the facilities cache.
Syntax
struct SIMCONNECT_DATA_FACILITY_WAYPOINT : public SIMCONNECT_DATA_FACILITY_AIRPORT {
float fMagVar;
};
Members
fMagVar
The magnetic variation of the waypoint in degrees.
Remarks
This structure is returned as one element in the SIMCONNECT_RECV_WAYPOINT_LIST structure. It inherits all the members of the SIMCONNECT_DATA_FACILITY_AIRPORT structure.
See the remarks for SimConnect_RequestFacilitiesList.
See Also
- SIMCONNECT_DATA_FACILITY_NDB
- SIMCONNECT_DATA_FACILITY_VOR
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_PERIOD
The SIMCONNECT_PERIODenumeration type is used with the SimConnect_RequestDataOnSimObjectcall to specify how often data is to be sent to the client.
Syntax
enum SIMCONNECT_PERIOD{
SIMCONNECT_PERIOD_NEVER,
SIMCONNECT_PERIOD_ONCE,
SIMCONNECT_PERIOD_VISUAL_FRAME,
SIMCONNECT_PERIOD_SIM_FRAME,
SIMCONNECT_PERIOD_SECOND,
};
Members
SIMCONNECT_PERIOD_NEVER
Specifies that the data is not to be sent.
SIMCONNECT_PERIOD_ONCE
Specifies that the data should be sent once only. Note that this is not an efficient way of receiving data frequently, use one of the other periods if there is a regular frequency to the data request.
SIMCONNECT_PERIOD_VISUAL_FRAME
Specifies that the data should be sent every visual (rendered) frame.
SIMCONNECT_PERIOD_SIM_FRAME
Specifies that the data should be sent every simulated frame, whether that frame is rendered or not.
SIMCONNECT_PERIOD_SECOND
Specifies that the data should be sent once everysecond.
Reference Samples
Primary samples |
|
Reference samples | Weather Station |
Remarks
Although the period definitions are specific, data is always transmitted at the end of a frame, so even if you have specified that data should be sent every second, the data will actually be transmitted at the end of the frame that comes on or after one second has elapsed.
See Also
SIMCONNECT_EXCEPTION
The SIMCONNECT_EXCEPTION enumeration typeis used with the SIMCONNECT_RECV_EXCEPTION structureto return information on an error that has occurred.
Syntax
enum SIMCONNECT_EXCEPTION{
SIMCONNECT_EXCEPTION_NONE = 0,
SIMCONNECT_EXCEPTION_ERROR = 1,
SIMCONNECT_EXCEPTION_SIZE_MISMATCH = 2,
SIMCONNECT_EXCEPTION_UNRECOGNIZED_ID = 3,
SIMCONNECT_EXCEPTION_UNOPENED = 4,
SIMCONNECT_EXCEPTION_VERSION_MISMATCH = 5,
SIMCONNECT_EXCEPTION_TOO_MANY_GROUPS = 6,
SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED = 7,
SIMCONNECT_EXCEPTION_TOO_MANY_EVENT_NAMES = 8,
SIMCONNECT_EXCEPTION_EVENT_ID_DUPLICATE = 9,
SIMCONNECT_EXCEPTION_TOO_MANY_MAPS = 10,
SIMCONNECT_EXCEPTION_TOO_MANY_OBJECTS = 11,
SIMCONNECT_EXCEPTION_TOO_MANY_REQUESTS = 12,
SIMCONNECT_EXCEPTION_WEATHER_INVALID_PORT = 13,
SIMCONNECT_EXCEPTION_WEATHER_INVALID_METAR = 14,
SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_GET_OBSERVATION = 15,
SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_CREATE_STATION = 16,
SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_REMOVE_STATION = 17,
SIMCONNECT_EXCEPTION_INVALID_DATA_TYPE = 18,
SIMCONNECT_EXCEPTION_INVALID_DATA_SIZE = 19,
SIMCONNECT_EXCEPTION_DATA_ERROR = 20,
SIMCONNECT_EXCEPTION_INVALID_ARRAY = 21,
SIMCONNECT_EXCEPTION_CREATE_OBJECT_FAILED = 22,
SIMCONNECT_EXCEPTION_LOAD_FLIGHTPLAN_FAILED = 23,
SIMCONNECT_EXCEPTION_OPERATION_INVALID_FOR_OJBECT_TYPE = 24,
SIMCONNECT_EXCEPTION_ILLEGAL_OPERATION = 25,
SIMCONNECT_EXCEPTION_ALREADY_SUBSCRIBED = 26,
SIMCONNECT_EXCEPTION_INVALID_ENUM = 27,
SIMCONNECT_EXCEPTION_DEFINITION_ERROR = 28,
SIMCONNECT_EXCEPTION_DUPLICATE_ID = 29,
SIMCONNECT_EXCEPTION_DATUM_ID = 30,
SIMCONNECT_EXCEPTION_OUT_OF_BOUNDS = 31,
SIMCONNECT_EXCEPTION_ALREADY_CREATED = 32,
SIMCONNECT_EXCEPTION_OBJECT_OUTSIDE_REALITY_BUBBLE = 33,
SIMCONNECT_EXCEPTION_OBJECT_CONTAINER = 34,
SIMCONNECT_EXCEPTION_OBJECT_AI = 35,
SIMCONNECT_EXCEPTION_OBJECT_ATC = 36,
SIMCONNECT_EXCEPTION_OBJECT_SCHEDULE = 37,
};
Members
General errors
SIMCONNECT_EXCEPTION_NONE
Specifies that there has not been an error. This value is not currently used.
SIMCONNECT_EXCEPTION_ERROR
An unspecific error has occurred. This can be from incorrect flag settings, null or incorrect parameters, the need to have at least one up or down event with an input event, failed calls from the SimConnect server to the operating system, among other reasons.
SIMCONNECT_EXCEPTION_SIZE_MISMATCH
Specifies the size of the data provided does not match the size required. This typically occurs when the wrong string length, fixed or variable, is involved.
SIMCONNECT_EXCEPTION_UNRECOGNIZED_ID
Specifies that the client event, request ID, data definition ID, or object ID was not recognized.
SIMCONNECT_EXCEPTION_UNOPENED
Specifies that communication with the SimConnect server has not been opened. This error is not currently used.
SIMCONNECT_EXCEPTION_VERSION_MISMATCH
Specifies a versioning error has occurred. Typically this will occur when a client built on a newer version of the SimConnect client dll attempts to work with an older version of the SimConnect server.
SIMCONNECT_EXCEPTION_TOO_MANY_GROUPS
Specifies that the maximum number of groups allowed has been reached. The maximum is 20.
SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED
Specifies that the simulation event name (such as "brakes") is not recognized.
SIMCONNECT_EXCEPTION_TOO_MANY_EVENT_NAMES
Specifies that the maximum number of event names allowed has been reached. The maximum is 1000.
SIMCONNECT_EXCEPTION_EVENT_ID_DUPLICATE
Specifies that the event ID has been used already. This can occur with calls to SimConnect_MapClientEventToSimEvent, or SimConnect_SubscribeToSystemEvent.
SIMCONNECT_EXCEPTION_TOO_MANY_MAPS
Specifies that the maximum number of mappings allowed has been reached. The maximum is 20.
SIMCONNECT_EXCEPTION_TOO_MANY_OBJECTS
Specifies that the maximum number of objects allowed has been reached. The maximum is 1000.
SIMCONNECT_EXCEPTION_TOO_MANY_REQUESTS
Specifies that the maximum number of requests allowed has been reached. The maximum is 1000.
SIMCONNECT_EXCEPTION_INVALID_DATA_TYPE
Specifies that the data type requested does not apply to the type of data requested. Typically this occurs with a fixed length string of the wrong length.
SIMCONNECT_EXCEPTION_INVALID_DATA_SIZE
Specifies that the size of the data provided is not what is expected. This can occur when the size of a structure provided does not match the size given, or a null string entry is made for a menu or sub-menu entry text, or data with a size of zero is added to a data definition. It can also occur with an invalid request to SimConnect_CreateClientData.
SIMCONNECT_EXCEPTION_DATA_ERROR
Specifies a generic data error. This error is used by the SimConnect_WeatherCreateThermal function to report incorrect parameters, such as negative radii or values greater than the maximum allowed. It is also used by the SimConnect_FlightSave and SimConnect_FlightLoad functions to report incorrect file types. It is also used by other functions to report that flags or reserved parameters have not been set to zero.
SIMCONNECT_EXCEPTION_INVALID_ARRAY
Specifies an invalid array has been sent to the SimConnect_SetDataOnSimObject function.
SIMCONNECT_EXCEPTION_ALREADY_SUBSCRIBED
Specifies that the client has already subscribed to that event.
SIMCONNECT_EXCEPTION_INVALID_ENUM
Specifies that the member of the enumeration provided was not valid. Currently this is only used if an unknown type is provided to SimConnect_RequestDataOnSimObjectType.
SIMCONNECT_EXCEPTION_DEFINITION_ERROR
Specifies that there is a problem with a data definition. Currently this is only used if a variable length definition is sent with SimConnect_RequestDataOnSimObject.
SIMCONNECT_EXCEPTION_DUPLICATE_ID
Specifies that the ID has already been used. This can occur with menu IDs, or with the IDs provided to SimConnect_AddToDataDefinition, SimConnect_AddClientEventToNotificationGroup or SimConnect_MapClientDataNameToID.
SIMCONNECT_EXCEPTION_DATUM_ID
Specifies that the datum ID is not recognized.This currently occurs with a call to the SimConnect_SetDataOnSimObject function.
SIMCONNECT_EXCEPTION_OUT_OF_BOUNDS
Specifies that the radius given in the SimConnect_RequestDataOnSimObjectType was outside the acceptable range, or with an invalid request to SimConnect_CreateClientData.
SIMCONNECT_EXCEPTION_ALREADY_CREATED
Specifies that a client data area with the name requested by a call to SimConnect_MapClientDataNameToID has already been created by another addon. Try again with a different name.
Weather system errors
SIMCONNECT_EXCEPTION_WEATHER_INVALID_PORT
Specifies an invalid port number was requested.
SIMCONNECT_EXCEPTION_WEATHER_INVALID_METAR
Specifies that the metar data supplied did not match the required format. See the section Metar Data Format for details on the format required.
SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_GET_OBSERVATION
Specifies that the weather observation requested was not available. Refer to the remarks section for SimConnect_WeatherRequestObservationAtStation for some notes on this exception.
SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_CREATE_STATION
Specifies that the weather station could not be created.
SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_REMOVE_STATION
Specifies that the weather station could not be removed.
AI errors
SIMCONNECT_EXCEPTION_CREATE_OBJECT_FAILED
Specifies that the attempt to create an AI object failed.
SIMCONNECT_EXCEPTION_LOAD_FLIGHTPLAN_FAILED
Specifies that the specified flight plan could not be found, or did not load correctly.
SIMCONNECT_EXCEPTION_OPERATION_INVALID_FOR_OBJECT_TYPE
Specifies that the operation requested does not apply to the object type, for example trying to set a flight plan on an object that is not an aircraft will result in this error.
SIMCONNECT_EXCEPTION_ILLEGAL_OPERATION
Specifies that the AI operation requested cannot be completed, such as requesting that an object be removed when the client did not create that object. This error also applies to the Weather system.
SIMCONNECT_EXCEPTION_OBJECT_OUTSIDE_REALITY_BUBBLE
Specifies that an attempt to create an ATC controlled AI object failed because the location of the object is outside the reality bubble.
SIMCONNECT_EXCEPTION_OBJECT_CONTAINER
Specifies that an attempt to create an AI object failed because of an error with the container system for the object.
SIMCONNECT_EXCEPTION_OBJECT_AI
Specifies that an attempt to create an AI object failed because of an error with the AI system for the object.
SIMCONNECT_EXCEPTION_OBJECT_ATC
Specifies that an attempt to create an AI object failed because of an error with the ATC system for the object.
SIMCONNECT_EXCEPTION_OBJECT_SCHEDULE
Specifies that an attempt to create an AI object failed because of a scheduling problem.
Reference Sample
Primary sample |
Remarks
In the contextofSimConnect, exceptions are error codes, and should not be confused withthe C# or system concepts of exceptions. Refer to the remarks for SimConnect_GetLastSentPacketID.
See Also
SIMCONNECT_FACILITY_LIST_TYPE
The SIMCONNECT_FACILITY_LIST_TYPE enumeration type is used to determine which type of facilities data is being requested or returned.
Syntax
enum SIMCONNECT_FACILITY_LIST_TYPE{
SIMCONNECT_FACILITY_LIST_TYPE_AIRPORT,
SIMCONNECT_FACILITY_LIST_TYPE_WAYPOINT,
SIMCONNECT_FACILITY_LIST_TYPE_NDB,
SIMCONNECT_FACILITY_LIST_TYPE_VOR,
SIMCONNECT_FACILITY_LIST_TYPE_COUNT
};
Members
SIMCONNECT_FACILITY_LIST_TYPE_AIRPORT
Specifies that the type of information is for an airport, see SIMCONNECT_DATA_FACILITY_AIRPORT.
SIMCONNECT_FACILITY_LIST_TYPE_WAYPOINT
Specifies that the type of information is for a waypoint, see SIMCONNECT_DATA_FACILITY_WAYPOINT.
SIMCONNECT_FACILITY_LIST_TYPE_NDB
Specifies that the type of information is for an NDB, see SIMCONNECT_DATA_FACILITY_NDB.
SIMCONNECT_FACILITY_LIST_TYPE_VOR
Specifies that the type of information is for a VOR, see SIMCONNECT_DATA_FACILITY_VOR.
SIMCONNECT_FACILITY_LIST_TYPE_COUNT
Not valid as a list type, but simply the number of list types.
Reference Sample
Primary sample |
Remarks
See the remarks for SimConnect_RequestFacilitiesList.
See Also
SIMCONNECT_MISSION_END
The SIMCONNECT_MISSION_END enumeration type is used to specify the three possible outcomes of a mission.
Syntax
enum SIMCONNECT_MISSION_END{
SIMCONNECT_MISSION_FAILED,
SIMCONNECT_MISSION_CRASHED,
SIMCONNECT_MISSION_SUCCEEDED
};
Members
SIMCONNECT_MISSION_FAILED
Specifies that the user did not complete the mission successfully
.
SIMCONNECT_MISSION_CRASHED
Specifies that the user aircraft crashed during the mission.
SIMCONNECT_MISSION_SUCCEEDED
Specifies that the user completed the mission successfully.
Reference Sample
Primary sample | Mission Action |
Remarks
Refer to the mission events that can be requested by the SimConnect_SubscribeToSystemEvent function. Also see the remarks for SimConnect_CompleteCustomMissionAction.
See Also
SIMCONNECT_RECV
The SIMCONNECT_RECV structure is used withthe SIMCONNECT_RECV_IDenumeration to indicate which type of structure has beenreturned.
Syntax
struct SIMCONNECT_RECV{
DWORD dwSize;
DWORD dwVersion;
DWORD dwID;
};
Members
dwSize
The total size of the returned structure in bytes(that is, not usually the size of the SIMCONNECT_RECVstructure, but of thestructure that inherits it).
dwVersion
The version number of the SimConnect server.
dwID
The ID of the returned structure. One member of SIMCONNECT_RECV_ID.
Reference Samples
Primary samples | |
Reference samples | All but a few of the other samples implement this structure. |
Remarks
This structure is inherited directly by:
- SIMCONNECT_RECV_AIRPORT_LIST
- SIMCONNECT_RECV_ASSIGNED_OBJECT_ID
- SIMCONNECT_RECV_CLOUD_STATE
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_EVENT
- SIMCONNECT_RECV_SIMOBJECT_DATA
- SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE
- SIMCONNECT_RECV_OPEN
- SIMCONNECT_RECV_RESERVED_KEY
- SIMCONNECT_RECV_SYSTEM_STATE
- SIMCONNECT_RECV_WEATHER_OBSERVATION
The structure is also inherited by SIMCONNECT_RECV_QUIT, which does not add any new members. This structure is received when the user quits Flight Sim World.
This structure is inherited by the SIMCONNECT_RECV_EVENT structure, which is inherited by several other structures:
- SIMCONNECT_RECV_CUSTOM_ACTION
- SIMCONNECT_RECV_EVENT_FILENAME
- SIMCONNECT_RECV_EVENT_FRAME
- SIMCONENCT_RECV_EVENT_OBJECT_ADDREMOVE
See Also
SIMCONNECT_RECV_AIRPORT_LIST
The SIMCONNECT_RECV_AIRPORT_LIST structure is used to return a list of SIMCONNECT_DATA_FACILITY_AIRPORT structures.
Syntax
struct SIMCONNECT_RECV_AIRPORT_LIST : public SIMCONNECT_RECV_FACILITIES_LIST{
SIMCONNECT_DATA_FACILITY_AIRPORT rgData[1];
};
Members
rgData[1]
Array of SIMCONNECT_DATA_FACILITY_AIRPORT structures.
Remarks
This structure inherits the SIMCONNECT_RECV_FACILITIES_LIST structure, which identifies the number of elements in the list, and the number of packets needed to transmit all the data.
See the remarks for SimConnect_RequestFacilitiesList.
See Also
- SimConnect_RequestFacilitiesList
- SIMCONNECT_RECV_FACILITIES_LIST
- SIMCONNECT_RECV_NDB_LIST
- SIMCONNECT_RECV_VOR_LIST
- SIMCONNECT_RECV_WAYPOINT_LIST
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_AUDIO_RESPONSE
The SIMCONNECT_RECV_AUDIO_RESPONSE structure is used to return audio data.
Syntax
struct SIMCONNECT_RECV_AUDIO_RESPONSE : public SIMCONNECT_RECV{
DWORD dwRequestID;
float val;
};
Members
dwRequestID
Double word containing the client defined request ID.
val
Requested value.
Remarks
None.
See Also
- SimConnect_GetVoiceVolume
- SimConnect_GetVoicePitch
- SimConnect_GetVoiceTimeRemaining
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_ASSIGNED_OBJECT_ID
The SIMCONNECT_RECV_ASSIGNED_OBJECT_ID structure is used to return an object ID that matches a request ID.
Syntax
struct SIMCONNECT_RECV_ASSIGNED_OBJECT_ID : public SIMCONNECT_RECV {
DWORD dwRequestID;
DWORD dwObjectID;
};
Members
dwRequestID
Double word containing the client defined request ID.
dwObjectID
Double word containing the server defined object ID.
Reference Samples
Primary samples | Managed AI Waypoints |
Remarks
Thisstructure inherits the SIMCONNECT_RECV structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID.
See Also
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SIMCONNECT_RECV_SIMOBJECT_DATA
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_CLIENT_DATA
The SIMCONNECT_RECV_CLIENT_DATA structure will be received by the client after a successful call to SimConnect_RequestClientData. It is an identical structure to SIMCONNECT_RECV_SIMOBJECT_DATA.
Syntax
struct SIMCONNECT_RECV_CLIENT_DATA : publicSIMCONNECT_RECV_SIMBOBJECT_DATA{
};
Remarks
This structure inherits the SIMCONNECT_RECV_SIMOBJECT_DATA structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_CLIENT_DATA.
See Also
- SimConnect API Reference
- SIMCONNECT_RECV
- SIMCONNECT_RECV_ID
- SIMCONNECT_RECV_SIMOBJECT_DATA
- SimConnect_RequestClientData
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_CAMERA_VIEW
The SIMCONNECT_RECV_CAMERA_VIEW structure is used to return an object ID that matches a request ID.
Syntax
struct SIMCONNECT_RECV_CAMERA_VIEW : public SIMCONNECT_RECV {
DWORD dwRequestID;
SIMCONNECT_DATA_CAMERA_VIEW dView;
};
Members
dwRequestID
Double word containing the client defined request ID.
dView
View data for the current camera, see SIMCONNECT_DATA_CAMERA_VIEW.
Remarks
This structure inherits the SIMCONNECT_RECV structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_CAMERA_DATA
See Also
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_CLOUD_STATE
The SIMCONNECT_RECV_CLOUD_STATE structure is used to return an array of cloud state data.
Syntax
struct SIMCONNECT_RECV_CLOUD_STATE : public SIMCONNECT_RECV {
DWORD dwRequestID;
DWORD dwArraySize;
BYTE rgbData[1];
};
Members
dwRequestID
Double word containing the client defined request ID.
dwArraySize
Double word starting the cloud data array.The array will be 64 x 64 bytes in size, and each byte will contain a value indicating the cloud density for each cell. A value of zero would mean no clouds, to a maximum of 255. The size of each cell is determined by a call to SimConnect_WeatherRequestCloudState.
rgbData[1]
Byte array containing the cloud data.
Remarks
This structure inherits the SIMCONNECT_RECV structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_CLOUD_STATE.
See Also
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SIMCONNECT_RECV_WEATHER_OBSERVATION
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_CUSTOM_ACTION
The SIMCONNECT_RECV_CUSTOM_ACTION structure is used specifically with the mission system, providing details on the custom action that has been triggered.
Syntax
struct SIMCONNECT_RECV_CUSTOM_ACTION : public SIMCONNECT_RECV_EVENT {
GUID guidInstanceId;
DWORD dwWaitForCompletion;
char szPayLoad[1];
};
Members
guidInstanceId
GUID of the action that executed.
dwWaitForCompletion
The value of the Wait-for-completion flag on the action.
szPayLoad
A variable length string that is defined in the mission xml file. It is specified by the mission designer and can contain anything that the client might find useful.
Reference Sample
Primary sample | Mission Action |
Remarks
This structure inherits the SIMCONNECT_RECV_EVENT structure, which inherits the SIMCONNECT_RECV structure, and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_CUSTOM_ACTION.
See the remarks for SimConnect_CompleteCustomMissionAction.
See Also
SIMCONNECT_RECV_EVENT
The SIMCONNECT_RECV_EVENT structure isused to return an event ID to the client.
Syntax
struct SIMCONNECT_RECV_EVENT : public SIMCONNECT_RECV {
DWORD uGroupID;
DWORD uEventID;
DWORD dwData;
};
Members
uGroupID
The ID of the client defined group, or the special casevalue: UNKNOWN_GROUP (which equals DWORD_MAX).
uEventID
The ID of the client defined event that has been requested(such as EVENT_1 or EVENT_BRAKES from the examples in thisdocument).
dwData
This value is usually zero, but some eventsrequire further qualification. For example, joystick movement events require a movement value in addition to the notification that the joystick has been moved (see SimConnect_MapInputEventToClientEvent for more information).
Reference Samples
Primary samples | |
Reference samples | All but a few of the other samples implement this structure. |
Remarks
Thisstructure inherits the SIMCONNECT_RECVstructure and is returned when the dwIDparameter of SIMCONNECT_RECVis set toSIMCONNECT_RECV_ID_EVENT.This structure is inherited by several other structures:- SIMCONNECT_RECV_CUSTOM_ACTION
- SIMCONNECT_RECV_EVENT_FILENAME
- SIMCONNECT_RECV_EVENT_FRAME
- SIMCONENCT_RECV_EVENT_OBJECT_ADDREMOVE
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED
See Also
- SimConnectAPI Reference
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SimConnectStructuresand Enumerations
SIMCONNECT_RECV_EVENT_FILENAME
The SIMCONNECT_RECV_EVENT_FILENAMEstructure is used to return a filename and an event ID to the client.
Syntax
struct SIMCONNECT_RECV_EVENT_FILENAME : public SIMCONNECT_RECV_EVENT {
char szFileName[MAX_PATH];
DWORD dwFlags;
};
Members
szFileName[MAX_PATH]
The returned filename.
dwFlags
Reserved, should be 0.
Reference Sample
Primary sample |
Remarks
This structure inherits the SIMCONNECT_RECV_EVENTstructure, and is used to attach a filename to the returned event.
When the SIMCONNECT_RECVstructure dwIDparameter is set toSIMCONNECT_RECV_EVENT_FILENAME,this structure isreturned.See Also
- SimConnectAPI Reference
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EVENT
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SimConnectStructuresand Enumerations
SIMCONNECT_RECV_EVENT_FRAME
The SIMCONNECT_RECV_EVENT_FRAME structure is used with the SimConnect_SubscribeToSystemEvent call to return the frame rate and simulation speed to the client.
Syntax
struct SIMCONNECT_RECV_EVENT_FRAME : public SIMCONNECT_RECV_EVENT {
float fFrameRate;
float fSimSpeed;
};
Members
fFrameRate
The visual frame rate in frames per second.
fSimSpeed
The simulation rate. For example if the simulation is running at four times normal speed - 4X - then 4.0 will be returned.
Remarks
Thisstructure inherits the SIMCONNECT_RECV_EVENT structure, which inherits the SIMCONNECT_RECV structure, and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_EVENT_FRAME. Set the requested system event to "Frame" or "PauseFrame" with the SimConnect_SubscribeToSystemEvent function to receive this data.
See Also
SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED
The SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED structure is sent to a client when they have successfully joined a multi-player race.
Syntax
struct SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED : public SIMCONNECT_RECV_EVENT {};
Members
This structure takes no parameters in addition to those inherited from the SIMCONNECT_RECV_EVENT structure.
Remarks
This event is not transmitted to the host of the session, only to the client that has joined in.
To receive these events, refer to the SimConnect_SubscribeToSystemEvent function.
See Also
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED
- SIMCONNECT_RECV_EVENT_RACE_END
- SIMCONNECT_RECV_EVENT_RACE_LAP
- SIMCONNECT_RECV_ID
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED
The SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED structure is sent to the host when the session is visible to other users in the lobby.
Syntax
struct SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED : public SIMCONNECT_RECV_EVENT {};
Members
This structure takes no parameters in addition to those inherited from the SIMCONNECT_RECV_EVENT structure.
Remarks
This event is sent only to the host of the session.
See Also
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED
- SIMCONNECT_RECV_EVENT_RACE_END
- SIMCONNECT_RECV_EVENT_RACE_LAP
- SIMCONNECT_RECV_ID
- SimConnect_SubscribeToSystemEvent
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED
The SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED structure is sent to a client when they have requested to leave a race, or to all players when the session is terminated by the host.
Syntax
struct SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED : public SIMCONNECT_RECV_EVENT {};
Members
This structure takes no parameters in addition to those inherited from the SIMCONNECT_RECV_EVENT structure.
Remarks
This is the only event that is broadcast to all the players in a multi-player race, in the situation where the host terminates, or simply leaves, the race. If a client ends their own participation in the race, they will be the only one to receive the event.
See Also
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED
- SIMCONNECT_RECV_EVENT_RACE_END
- SIMCONNECT_RECV_EVENT_RACE_LAP
- SIMCONNECT_RECV_ID
- SimConnect_SubscribeToSystemEvent
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE
The SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE structure is used to return the type and ID of an AI object that has been added or removed from the simulation, by any client.
Syntax
struct SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE : public SIMCONNECT_RECV_EVENT {
SIMCONNECT_SIMOBJECT_TYPE eObjType;
};
Members
eObjType
Specifies the type of object that was added or removed. One member of the SIMCONNECT_SIMOBJECT_TYPE enumeration.
Reference Sample
Primary sample |
Remarks
Thisstructure inherits the SIMCONNECT_RECV_EVENT structure, which inherits the SIMCONNECT_RECV structure, and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_EVENT_ADDREMOVE. A client can determine whether the object was added or removed from its own event ID that was provided as a parameter to the SimConnect_SubscribeToSystemEvent function.
The ID of the object added or removed is returned in the dwData parameter (a member of the SIMCONNECT_RECV_EVENT structure).
See Also
SIMCONNECT_RECV_EVENT_RACE_END
The SIMCONNECT_RECV_EVENT_RACE_END structure is used in multi-player racing to hold the results for one player at the end of a race.
Syntax
struct SIMCONNECT_RECV_EVENT_RACE_END : public SIMCONNECT_RECV_EVENT {
DWORD dwRacerNumber;
SIMCONNECT_DATA_RACE_RESULT RacerData;
};
Members
dwRacerNumber
The index of the racer the results are for.Players are indexed from 0.
RacerData
A SIMCONNECT_DATA_RACE_RESULT structure.
Remarks
In a multi-player race players can come and go, so index numbers are not a reliable means of identifiying the players. The szPlayerName and szPlayerRole parameters of the SIMCONNECT_DATA_RACE_RESULT structure should be used to identify each player.
See Also
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED
- SIMCONNECT_RECV_EVENT_RACE_LAP
- SIMCONNECT_RECV_ID
- SimConnect_SubscribeToSystemEvent
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_EVENT_RACE_LAP
The SIMCONNECT_RECV_EVENT_RACE_LAP structure is used in multi-player racing to hold the results for one player at the end of a lap.
Syntax
struct SIMCONNECT_RECV_EVENT_RACE_LAP : public SIMCONNECT_RECV_EVENT {
DWORD dwLapIndex;
SIMCONNECT_DATA_RACE_RESULT RacerData;
};
Members
dwLapIndex
The index of the lap the results are for.Laps are indexed from 0.
RacerData
A SIMCONNECT_DATA_RACE_RESULT structure.
Remarks
None.
See Also
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED
- SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED
- SIMCONNECT_RECV_EVENT_RACE_END
- SIMCONNECT_RECV_ID
- SimConnect_SubscribeToSystemEvent
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_EXCEPTION
The SIMCONNECT_RECV_EXCEPTION structure isused with the SIMCONNECT_EXCEPTIONenumeration type to return information on an error that has occurred.
Syntax
struct SIMCONNECT_RECV_EXCEPTION : public SIMCONNECT_RECV {
DWORD dwException;
DWORD dwSendID;
DWORD dwIndex;
};
Members
dwException
One member of the SIMCONNECT_EXCEPTIONenumeration type, indicating which error has occurred.
dwSendID
The ID of the packet that contained the error, seeRemarks below.
dwIndex
The index number (starting at 1) of the first parameter that caused an error. Special case: UNKNOWN_INDEX = 0.
Reference Samples
Primary samples |
Remarks
Thisstructure inherits the SIMCONNECT_RECVstructure and is returned when the dwIDparameter of SIMCONNECT_RECVis set toSIMCONNECT_RECV_ID_EXCEPTION.
In order to match the dwSendIDparameter returned here, with the ID of a request, use the SimConnect_GetLastSentPacketIDcall after each request is made.
Note that the HRESULT errors returned after each API call do notinvolve any communication with the SimConnect server, but are simplyclient-side errors that are returned immediately. Testfor exceptions to check for server-sideerrors.See Also
- SimConnectAPI Reference
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EVENT
- SIMCONNECT_RECV_ID
- SIMCONNECT_RECV_SIMOBJECT_DATA
- SimConnectStructuresand Enumerations
SIMCONNECT_RECV_FACILITIES_LIST
The SIMCONNECT_RECV_FACILITIES_LIST structure is used to provide information on the number of elements in a list of facilities returned to the client, and the number of packets that were used to transmit the data.
Syntax
struct SIMCONNECT_RECV_FACILITIES_LIST : public SIMCONNECT_RECV{
DWORD dwRequestID;
DWORD dwArraySize;
DWORD dwREntry;
DWORD dwOutOf;
};
Members
dwRequestID
Double word containing the client defined request ID.
dwArraySize
Double word containing the number of elements in the list that are within this packet. For example, if there are 25 airports returned in the SIMCONNECT_RECV_AIRPORT_LIST structure, then this field will contain 25, but if there are 400 airports in the list and the data is returned in two packets, then this value will contain the number of entries within each packet.
dwEntry
Double word containing the index number of this list packet. This number will be from 0 to dwOutOf - 1.
dwOutOf
Double word containing the total number of packets used to transmit the list.
Remarks
This structure is inherited by SIMCONNECT_RECV_AIRPORT_LIST, SIMCONNECT_RECV_NDB_LIST, SIMCONNECT_RECV_VOR_LIST and SIMCONNECT_RECV_WAYPOINT_LIST.
This structure inherits the SIMCONNECT_RECV structure, so use the SIMCONNECT_RECV_ID enumeration to determine which list structure has been received.
See the remarks for SimConnect_RequestFacilitiesList.
See Also
- SimConnect_RequestFacilitiesList
- SimConnect API Reference
- SIMCONNECT_RECV
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_ID
The SIMCONNECT_RECV_ID enumeration type isused within theSIMCONNECT_RECVstructure to indicate which type of structure has beenreturned.
Syntax
enum SIMCONNECT_RECV_ID{
SIMCONNECT_RECV_ID_NULL,
SIMCONNECT_RECV_ID_EXCEPTION,
SIMCONNECT_RECV_ID_OPEN,
SIMCONNECT_RECV_ID_QUIT,
SIMCONNECT_RECV_ID_EVENT,
SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE,
SIMCONNECT_RECV_ID_EVENT_FILENAME,
SIMCONNECT_RECV_ID_EVENT_FRAME,
SIMCONNECT_RECV_ID_SIMOBJECT_DATA,
SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE,
SIMCONNECT_RECV_ID_CLOUD_STATE,
SIMCONNECT_RECV_ID_WEATHER_OBSERVATION,
SIMCONNECT_RECV_ID_ASSIGNED_OJBECT_ID,
SIMCONNECT_RECV_ID_RESERVED_KEY,
SIMCONNECT_RECV_ID_CUSTOM_ACTION,
SIMCONNECT_RECV_ID_SYSTEM_STATE,
SIMCONNECT_RECV_ID_CLIENT_DATA,
SIMCONNECT_RECV_ID_EVENT_WEATHER_MODE,
SIMCONNECT_RECV_ID_AIRPORT_LIST,
SIMCONNECT_RECV_ID_VOR_LIST,
SIMCONNECT_RECV_ID_NDB_LIST,
SIMCONNECT_RECV_ID_WAYPOINT_LIST,
SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SERVER_STARTED,
SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_CLIENT_STARTED,
SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SESSION_ENDED,
SIMCONNECT_RECV_ID_EVENT_RACE_END,
SIMCONNECT_RECV_ID_EVENT_RACE_LAP
};
Members
SIMCONNECT_RECV_ID_NULL
Specifies that nothing useful has been returned.
SIMCONNECT_RECV_ID_EXCEPTION
Specifies that a SIMCONNECT_RECV_EXCEPTION structure has been received.
SIMCONNECT_RECV_ID_OPEN
Specifies that a SIMCONNECT_RECV_OPEN structure has been received.
SIMCONNECT_RECV_ID_QUIT
Specifies that the user has exited from FlightSim World.
SIMCONNECT_RECV_ID_EVENT
Specifies that a SIMCONNECT_RECV_EVENT structure has been received.
SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE
Specifies that a SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE structure has been received.
SIMCONNECT_RECV_ID_EVENT_FILENAME
Specifies that a SIMCONNECT_RECV_EVENT_FILENAME structure has been received.
SIMCONNECT_RECV_ID_EVENT_FRAME
Specifies that a SIMCONNECT_RECV_EVENT_FRAME structure has been received.
SIMCONNECT_RECV_ID_SIMOBJECT_DATA
Specifies that a SIMCONNECT_RECV_SIMOBJECT_DATA structure has been received.
SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE
Specifies that a SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE structure has been received.
SIMCONNECT_RECV_ID_WEATHER_OBSERVATION
Specifies that a SIMCONNECT_RECV_WEATHER_OBSERVATION structure has been received.
SIMCONNECT_RECV_ID_CLOUD_STATE
Specifies that a SIMCONNECT_RECV_CLOUD_STATE structure has been received.
SIMCONNECT_RECV_ID_ASSIGNED_OJBECT_ID
Specifies that a SIMCONNECT_RECV_ASSIGNED_OBJECT_ID structure has been received.
SIMCONNECT_RECV_ID_RESERVED_KEY
Specifies that a SIMCONNECT_RECV_RESERVED_KEY structure has been received.
SIMCONNECT_RECV_ID_CUSTOM_ACTION
Specifies that a SIMCONNECT_RECV_CUSTOM_ACTION structure has been received.
SIMCONNECT_RECV_ID_SYSTEM_STATE
Specifies that a SIMCONNECT_RECV_SYSTEM_STATE structure has been received.
SIMCONNECT_RECV_ID_CLIENT_DATA
Specifies that a SIMCONNECT_RECV_CLIENT_DATA structure has been received.
SIMCONNECT_RECV_ID_CLIENT_DATA
Specifies that the dwData parameter will contain one value of the SIMCONNECT_WEATHER_MODE enumeration.
SIMCONNECT_RECV_ID_AIRPORT_LIST
Specifies that a SIMCONNECT_RECV_AIRPORT_LIST structure has been received.
SIMCONNECT_RECV_ID_VOR_LIST
Specifies that a SIMCONNECT_RECV_VOR_LIST structure has been received.
SIMCONNECT_RECV_ID_NDB_LIST
Specifies that a SIMCONNECT_RECV_NDB_LIST structure has been received.
SIMCONNECT_RECV_ID_WAYPOINT_LIST
Specifies that a SIMCONNECT_RECV_WAYPOINT_LIST structure has been received.
SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SERVER_STARTED
Specifies that a SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED structrure has been received.
SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_CLIENT_STARTED
Specifies that a SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED structure has been received.
SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SESSION_ENDED
Specifies that a SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED structure has been received.
SIMCONNECT_RECV_ID_EVENT_RACE_END
Specifies that a SIMCONNECT_RECV_EVENT_RACE_END structure has been received.
SIMCONNECT_RECV_ID_EVENT_RACE_LAP
Specifies that a SIMCONNECT_RECV_EVENT_RACE_LAP structure has been received.
Reference Samples
Primary samples | |
Reference samples | All but a few of the other samples implement this enumeration. |
Remarks
Typically a DispatchProc or SimConnect_GetNextDispatch implementation of a client will include a case statement for each of the above members that the client might receive.
See Also
SIMCONNECT_RECV_OBJECT_AT_POINT
The SIMCONNECT_RECV_OBJECT_AT_POINT structure is used to return the location and type of scenery under an X/Y location in the window.
Syntax
struct SIMCONNECT_RECV_OBJECT_AT_POINT : public SIMCONNECT_RECV {
DWORD dwRequestID;
DWORD dwObjectID;
SIMCONNECT_DETECT_TYPE DetectType;
double Latitude;
double Longitude;
double Altitude;
double AltitudeAGL;
double Pitch;
double Bank;
double Heading;
};
Members
dwRequestID
Double word containing the client defined request ID.
dwObjectID
Client-defined Object ID for the scenery object, if any.
DetectType
Enumerated value describing whether the point given collided with an object, the ground or nothing using SIMCONNECT_DETECTED_OBJECT, SIMCONNECT_DETECTED_TERRAIN or SIMCONNECT_DETECTED_NONE.
Latitude
Latitude of the terrain or object under the point given.
Longitude
Longitude of the terrain or object under the point given.
Altitude
Altitude of the terrain or object under the point given.
AltitudeAGL
Altitude above ground level of the object's center point. For terrain, this will always be 0.
Pitch
Pitch of the object under the point given. For terrain, this will always be 0.
Bank
Bank of the object under the point given. For terrain, this will always be 0.
Heading
Heading of the object under the point given. For terrain, this will always be 0.
Remarks
This structure inherits the SIMCONNECT_RECV structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_LOCATION_DATA.
See Also
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SimConnect API Reference
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_NDB_LIST
The SIMCONNECT_RECV_NDB_LIST structure is used to return a list of SIMCONNECT_DATA_FACILITY_NDB structures.
Syntax
struct SIMCONNECT_RECV_NDB_LIST : public SIMCONNECT_RECV_FACILITES_LIST{
SIMCONNECT_DATA_FACILITY_NDB rgData[1];
};
Members
rgData[1]
Array of SIMCONNECT_DATA_FACILITY_NDB structures.
Remarks
This structure inherits the SIMCONNECT_RECV_FACILITIES_LIST structure, which identifies the number of elements in the list, and the number of packets needed to transmit all the data.
See the remarks for SimConnect_RequestFacilitiesList.
See Also
- SimConnect_RequestFacilitiesList
- SIMCONNECT_RECV_AIRPORT_LIST
- SIMCONNECT_RECV_FACILITIES_LIST
- SIMCONNECT_RECV_VOR_LIST
- SIMCONNECT_RECV_WAYPOINT_LIST
- SimConnect API Reference
- SIMCONNECT_RECV
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_SIMOBJECT_DATA
The SIMCONNECT_RECV_SIMOBJECT_DATA structurewill be received by the client after a successful call to SimConnect_RequestDataOnSimObject or SimConnect_RequestDataOnSimObjectType.
Syntax
struct SIMCONNECT_RECV_SIMOBJECT_DATA : public SIMCONNECT_RECV {
DWORD dwRequestID;
DWORD dwObjectID;
DWORD dwDefineID;
DWORD dwFlags;
DWORD dwentrynumber;
DWORD dwoutof;
DWORD dwDefineCount;
DWORD dwData;
};
Members
dwRequestID
The ID of the client defined request.
dwDefineID
The ID of the client defined data definition.
dwFlags
The flags that were set for this data request, see SimConnect_RequestDataOnSimObject for a description of the flags. This parameter will always be set to zero if the call was SimConnect_RequestDataOnSimObjectType.
dwentrynumber
If multiple objects are being returned, this isthe index number of this object out of a total of dwoutof. This will always be 1 if the call was SimConnect_RequestDataOnSimObject, and can be 0 or more if the call was SimConnect_RequestDataOnSimObjectType.
dwoutof
The total number of objects being returned. Notethat dwentrynumber and dwoutof start with 1 not 0, so if two objects are being returned dwentrynumber and dwoutof pairs will be 1,2 and 2,2 for the two objects. This will always be 1 if the call was SimConnect_RequestDataOnSimObject, and can be 0 or more if the call was SimConnect_RequestDataOnSimObjectType.
dwDefineCount
The number of 8-byte elements in the dwData array.
dwData
A data array containing information on aspecified object in8-byte (double word) elements. The length of the array isdwDefineCount.
Reference Samples
Primary samples |
Remarks
Thisstructure inherits the SIMCONNECT_RECVstructure and is returned when the dwIDparameter of SIMCONNECT_RECVis set toSIMCONNECT_RECV_ID_SIMOBJECT_DATA.
See Also
- SimConnectAPI Reference
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EVENT
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE
- SimConnectStructuresand Enumerations
SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE
The SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPEstructure will be received by the client after a successful callto SimConnect_RequestDataOnSimObjectType. It is an identical structure to SIMCONNECT_RECV_SIMOBJECT_DATA.
Syntax
struct SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE : publicSIMCONNECT_RECV_SIMBOBJECT_DATA{
};
Remarks
This structure inherits the SIMCONNECT_RECV_SIMOBJECT_DATA structure and is returned when the dwID parameter of SIMCONNECT_RECV is set toSIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE.
See Also
- SimConnectAPI Reference
- SIMCONNECT_RECV
- SIMCONNECT_RECV_ID
- SIMCONNECT_RECV_SIMOBJECT_DATA
- SimConnect_RequestDataOnSimObjectType
- SimConnectStructuresand Enumerations
SIMCONNECT_RECV_OPEN
The SIMCONNECT_RECV_OPEN structure is used to return information to the client, after a successful call to SimConnect_Open.
Syntax
struct SIMCONNECT_RECV_OPEN : public SIMCONNECT_RECV {
char szApplicationName[256];
DWORD dwApplicationVersionMajor;
DWORD dwApplicationVersionMinor;
DWORD dwApplicationBuildMajor;
DWORD dwApplicationBuildMinor;
DWORD dwSimConnectVersionMajor;
DWORD dwSimConnectVersionMinor;
DWORD dwSimConnectBuildMajor;
DWORD dwSimConnectBuildMinor;
DWORD dwReserved1;
DWORD dwReserved2;
};
Members
szApplicationName[256]
Null-terminated string containing the application name.
dwApplicationVersionMajor
Double word containing the application version major number.
dwApplicationVersionMinor
Double word containing the application version minor number.
dwApplicationBuildMajor
Double word containing the application build major number.
dwApplicationBuildMinor
Double word containing the application build minor number.
dwSimConnectVersionMajor
Double word containing the SimConnect version major number.
dwSimConnectVersionMinor
Double word containing the SimConnect version minor number.
dwSimConnectBuildMajor
Double word containing the SimConnect build major number.
dwSimConnectBuildMinor
Double word containing the SimConnect build minor number.
dwReserved1
Reserved.
dwReserved2
Reserved.
Remarks
Thisstructure inherits the SIMCONNECT_RECV structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_OPEN.
See Also
- SimConnect API Reference
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_RESERVED_KEY
The SIMCONNECT_RECV_RESERVED_KEY structure is used with the SimConnect_RequestReservedKey function to return the reserved key combination.
Syntax
struct SIMCONNECT_RECV_RESERVED_KEY : public SIMCONNECT_RECV {
char szChoiceReserved[30];
char szReservedKey[50];
};
Members
szChoiceReserved[30]
Null-terminated string containing the key that has been reserved.This will be identical to the string entered as one of the choices for the SimConnect_RequestReservedKey function.
szReservedKey[50]
Null-terminated string containing the reserved key combination. This will be an uppercase string containing all the modifiers that apply. For example, if the client program requests "q", and the choice is accepted, then this parameter will contain "TAB+Q". If the client program requests "Q", then this parameter will contain "SHIFT+TAB+Q". This string could then appear, for example, in a dialog from the client application, informing a user of the appropriate help key.
Reference Sample
Primary sample |
Remarks
Thisstructure inherits the SIMCONNECT_RECV structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_RESERVED_KEY.
See Also
- SimConnect API Reference
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_SYSTEM_STATE
The SIMCONNECT_RECV_SYSTEM_STATE structure is used with the SimConnect_RequestSystemState function to retrieve specific Flight Sim World systems states and information.
Syntax
typedef struct SIMCONNECT_RECV_SYSTEM_STATE : public SIMCONNECT_RECV {
DWORD dwRequestID;
DWORD dwInteger;
float fFloat;
char szString[MAX_PATH];
};
Members
dwRequestIDDouble word containing the client defined request ID.
dwInteger
Double word containing an integer, or boolean, value.
fFloat
A float value.
szString
Null-terminated string.
Remarks
Thisstructure inherits the SIMCONNECT_RECV structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_SYSTEM_STATE.
Typically only one of the received integer, float or string will contain information, which one will depend on the request and can be identified by the request ID. Refer to the descriptions of the SimConnect_SetSystemState and SimConnect_RequestSystemState functions.
See Also
- SimConnectAPI Reference
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SimConnectStructuresand Enumerations
SIMCONNECT_RECV_VOR_LIST
The SIMCONNECT_RECV_VOR_LIST structure is used to return a list of SIMCONNECT_DATA_FACILITY_VOR structures.
Syntax
struct SIMCONNECT_RECV_VOR_LIST : public SIMCONNECT_RECV_FACILITIES_LIST{
SIMCONNECT_DATA_FACILITY_VOR rgData[1];
};
Members
rgData[1]
Array of SIMCONNECT_DATA_FACILITY_VOR structures.
Remarks
This structure inherits the SIMCONNECT_RECV_FACILITIES_LIST structure, which identifies the number of elements in the list, and the number of packets needed to transmit all the data.
See the remarks for SimConnect_RequestFacilitiesList.
See Also
- SimConnect_RequestFacilitiesList
- SIMCONNECT_RECV_AIRPORT_LIST
- SIMCONNECT_RECV_FACILITIES_LIST
- SIMCONNECT_RECV_NDB_LIST
- SIMCONNECT_RECV_WAYPOINT_LIST
- SimConnect API Reference
- SIMCONNECT_RECV
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_WAYPOINT_LIST
The SIMCONNECT_RECV_WAYPOINT_LIST structure is used to return a list of SIMCONNECT_DATA_FACILITY_WAYPOINT structures.
Syntax
struct SIMCONNECT_RECV_WAYPOINT_LIST : public SIMCONNECT_RECV_FACILITIES_LIST{
SIMCONNECT_DATA_FACILITY_WAYPOINT rgData[1];
};
Members
rgData[1]
Array of SIMCONNECT_DATA_FACILITY_WAYPOINT structures.
Remarks
This structure inherits the SIMCONNECT_RECV_FACILITIES_LIST structure, which identifies the number of elements in the list, and the number of packets needed to transmit all the data.
See the remarks for SimConnect_RequestFacilitiesList.
See Also
- SimConnect_RequestFacilitiesList
- SIMCONNECT_RECV_AIRPORT_LIST
- SIMCONNECT_RECV_FACILITIES_LIST
- SIMCONNECT_RECV_NDB_LIST
- SIMCONNECT_RECV_VOR_LIST
- SimConnect API Reference
- SIMCONNECT_RECV
- SimConnect Structures and Enumerations
SIMCONNECT_RECV_WEATHER_OBSERVATION
The SIMCONNECT_RECV_WEATHER_OBSERVATIONstructure is used to return weather observation data, after calls to one of: SimConnect_WeatherRequestInterpolatedObservation, SimConnect_WeatherRequestObservationAtStation, or SimConnect_WeatherRequestObservationAtNearestStation
Syntax
struct SIMCONNECT_RECV_WEATHER_OBSERVATION : public SIMCONNECT_RECV {
DWORD dwRequestID;
char szMETAR[1];
};
Members
dwRequestID
The ID of the client defined request.
szMETAR[1]
Null-terminated string containing the Metar weatherdata. The maximum length of this string is 2000 chars.See the section Metar Data Format for details on the format required.
Reference Sample
Primary sample | Weather Station |
Remarks
Thisstructure inherits the SIMCONNECT_RECV structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_WEATHER_OBSERVATION.
See Also
- SimConnectAPI Reference
- SIMCONNECT_RECV_CLOUD_STATE
- SIMCONNECT_RECV
- SIMCONNECT_RECV_EVENT
- SIMCONNECT_RECV_EXCEPTION
- SIMCONNECT_RECV_ID
- SIMCONNECT_RECV_SIMOBJECT_DATA
- SimConnectStructuresand Enumerations
SIMCONNECT_SIMOBJECT_TYPE
The SIMCONNECT_SIMOBJECT_TYPE enumerationtype is used with the SimConnect_RequestDataOnSimObjectTypecall to request information on specific or nearby objects.
Syntax
enum SIMCONNECT_SIMOBJECT_TYPE{
SIMCONNECT_SIMOBJECT_TYPE_USER,
SIMCONNECT_SIMOBJECT_TYPE_ALL_CRAFT,
SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT,
SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER,
SIMCONNECT_SIMOBJECT_TYPE_BOAT,
SIMCONNECT_SIMOBJECT_TYPE_GROUND,
SIMCONNECT_SIMOBJECT_TYPE_MISSION
};
Members
SIMCONNECT_SIMOBJECT_TYPE_USER
Specifies the user's aircraft.
SIMCONNECT_SIMOBJECT_TYPE_ALL_CRAFT
Specifies all AI controlled objects. The older definition of SIMCONNECT_SIMOBJECT_TYPE_ALL still exists for compatibility.
SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT
Specifies all aircraft.
SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER
Specifies all helicopters.
SIMCONNECT_SIMOBJECT_TYPE_BOAT
Specifies all AI controlled boats.
SIMCONNECT_SIMOBJECT_TYPE_GROUND
Specifies all AI controlled ground vehicles.
SIMCONNECT_SIMOBJECT_TYPE_MISSION
Specifies all Mission System objects i.e. Actions, Triggers, Goals.
Reference Samples
Primary samples |
|
Reference samples |
Remarks
Thisenum is used to specify the return of the object IDs of all objects created using the AI creation functions, whether they are created by this client, other clients, or Flight Sim World itself. It can also be used to specify the return the object ID of the user aircraft. However it cannot be used to specify the IDs of objects like cars moving on freeways, which are not controlledby the AI component.
See the remarks and examples for SimConnect_AddToDataDefinition.
See Also
- SimConnectAPI Reference
- SimConnect_RequestDataOnSimObjectType
- SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE
- SimConnectStructuresand Enumerations
SIMCONNECT_STATE
The SIMCONNECT_STATE enumeration type isused with the SimConnect_SetSystemEventStatecall to turn the reporting of events on and off.
Syntax
enum SIMCONNECT_STATE{
SIMCONNECT_STATE_OFF,
SIMCONNECT_STATE_ON
};
Members
SIMCONNECT_STATE_OFF
Specifies off.
SIMCONNECT_STATE_ON
Specifies on.
Reference Samples
Primary samples | |
Reference samples | Set Data |
Remarks
See the remarks for SimConnect_MapInputEventToClientEvent.
See Also
SIMCONNECT_DATA_INITPOSITION
The SIMCONNECT_DATA_INITPOSITIONstructure is used to initialize the position of the user aircraft, AI controlled aircraft, or other simulation object.
Syntax
struct SIMCONNECT_DATA_INITPOSITION{
double Latitude;
double Longitude;
double Altitude;
double Pitch;
double Bank;
double Heading;
DWORD OnGround;
DWORD Airspeed;
};
Members
Latitude
Latitude in degrees.
Longitude
Longitude in degrees.
Altitude
Altitude in feet.
Pitch
Pitch in degrees.
Bank
Bank in degrees.
Heading
Heading in degrees.
OnGround
Set this to 1 to place the object on the ground, or 0 if the object is to be airborne.
Airspeed
The airspeed in knots, or one of the following special values:
Define | Value | Description |
INITPOSITION_AIRSPEED_CRUISE | -1 | The aircraft's design cruising speed. |
INITPOSITION_AIRSPEED_KEEP | -2 | Maintain the current airspeed. |
Reference Samples
Primary samples | Managed AI Waypoints |
Remarks
The primary use of this structure is to initialize the positioning of the user aircraft, because it also optimizes some of the terrain systems and other Flight Sim World systems. Simply setting parameters such as latitude, longitude and altitude does not perform this kind of optimization. This structure should not be used to incrementally move the user aircraft (as this will unnecessarily initiate the reloading of scenery), in this case change the latitude, longitude, altitude and other parameters of the aircraft appropriately (using the variables described in the Simulation Variables document).
This structure can be used to incrementally move or reposition an AI controlled aircraft, or any other aircraft not controlled by the user, as the terrain system optimizations are not performed in this case.
This structure is used by the functions: SimConnect_AICreateNonATCAircraft, SimConnect_AICreateSimulatedObject and SimConnect_AddToDataDefinition.
This structure can only be used to set data, it cannot be used as part of a data request.
See Also
SIMCONNECT_DATA_LATLONALT
The SIMCONNECT_DATA_LATLONALT structure is used to hold a world position.
Syntax
struct SIMCONNECT_DATA_LATLONALT{
double Latitude;
double Longitude;
double Altitude;
};
Members
Latitude
The latitude of the position in degrees.
Longitude
The longitude of the position in degrees.
Altitude
The altitude of the position in feet.
Remarks
This structure is used when one of the following simulation variables is requested (with a call to SimConnect_RequestDataOnSimObject):
- ADF LATLONALT
- NAV DME LATLONALT
- NAV GS LATLONALT
- NAV VOR LATLONALT
- INNER MARKER LATLONALT
- MIDDLE MARKER LATLONALT
- OUTER MARKER LATLONALT
See Also
- SimConnect API Reference
- SIMCONNECT_DATATYPE
- SimConnect Structures and Enumerations
- SimConnectAPI Reference
- SIMCONNECT_DATATYPE
- SIMCONNECT_DATA_INITPOSITION
- SimConnectStructuresand Enumerations
- SimConnect API Reference
- SIMCONNECT_DATATYPE
- SimConnect Structures and Enumerations
SIMCONNECT_DATA_MARKERSTATE
The SIMCONNECT_DATA_MARKERSTATEstructure is used to help graphically link flight model data with the graphics model.
Syntax
struct SIMCONNECT_DATA_MARKERSTATE{
char szMarkerName[64];
DWORD dwMarkerState;
};
Members
szMarkerName[64]
Null-terminated string containing the markername. One from the following table:
String |
Cg |
ModelCenter |
Wheel |
Skid |
Ski |
Float |
Scrape |
Engine |
Prop |
Eyepoint |
LongScale |
LatScale |
VertScale |
AeroCenter |
WingApex |
RefChord |
Datum |
WingTip |
FuelTank |
Forces |
dwMarkerState
Double word containing the marker state, set to 1 for on and 0 for off.
Remarks
The SimConnect_AddToDataDefinition call can be used to add a SIMCONNECT_DATA_MARKERSTATE structure to a data definition. Use of this call and structure is to help determine that points specified in the flight model of an aircraft match the graphics model for that aircraft, by turning on the specified marker lights. A SimConnect client created to do this becomes a tool to aid to the accurate development of aircraft models, rather than an add-on that an end user might run.
This structure can only be used as input, it cannot be used as part of a data request.
See Also
SIMCONNECT_DATA_WAYPOINT
The SIMCONNECT_DATA_WAYPOINT structure is used to hold all the necessary information on a waypoint.
Syntax
struct SIMCONNECT_DATA_WAYPOINT{
double Latitude;
double Longitude;
double Altitude;
unsigned long Flags;
double ktsSpeed;
double percentThrottle;
};
Members
Latitude
The latitude of the waypoint in degrees.
Longitude
The longitude of the waypoint in degrees.
Altitude
The altitude of the waypoint in feet.
Flags
Specifies the flags set for this waypoint, see SIMCONNECT_WAYPOINT_FLAGS.These flags can be OR'ed together, for example:Flags = SIMCONNECT_WAYPOINT_ON_GROUND
| SIMCONNECT_WAYPOINT_REVERSE
;
ktsSpeed
Specifies the required speed in knots. If a specific speed is required, then the SIMCONNECT_WAYPOINT_SPEED_REQUESTED flag must be set to True.
percentThrottle
Specifies the required throttle as a percentage. If a specific throttle percentage is required, then the SIMCONNECT_THROTTLE_REQUESTED flag must be set to True.
Reference Sample
Primary sample | AI Objects and Waypoints Managed AI Waypoints |
Remarks
The SimConnect_AddToDataDefinition call can be used to add a SIMCONNECT_DATA_WAYPOINT structure to a data definition. A list of waypoints is sent to an AI object using the SimConnect_SetDataOnSimObject function. There is no limit to the number of waypoints that can be sent to an object. If just one waypoint is set, the SIMCONNECT_WAYPOINT_WRAP_TO_FIRST flag should not be used.
If a speed is requested at a waypoint, the slower that speed is the closer the object will approach the exact point of the waypoint, requests for high speeds can result in the AI system turning the object some way off of the waypoint. The pitch, bank and heading of objects controlled by the waypoint system are determined by the AI pilot, and cannot be set from a client.
This structure can only be used to set data, it cannot be used as part of a data request.
See Also
SIMCONNECT_DATA_XYZ
The SIMCONNECT_DATA_XYZ structure is used to hold a 3D co-ordinate.
Syntax
struct SIMCONNECT_DATA_XYZ{
double x;
double y;
double z;
};
Members
x
The position along the x axis.
y
The position along the y axis.
z
The position along the z axis.
See Also
SIMCONNECT_TEXT_RESULT
The SIMCONNECT_TEXT_RESULT enumeration type is used to specify which event has occurred as a result of a call to SimConnect_Text.
Syntax
enum SIMCONNECT_TEXT_RESULT{
SIMCONNECT_TEXT_RESULT_MENU_SELECT_1,
SIMCONNECT_TEXT_RESULT_MENU_SELECT_2,
SIMCONNECT_TEXT_RESULT_MENU_SELECT_3,
SIMCONNECT_TEXT_RESULT_MENU_SELECT_4,
SIMCONNECT_TEXT_RESULT_MENU_SELECT_5,
SIMCONNECT_TEXT_RESULT_MENU_SELECT_6,
SIMCONNECT_TEXT_RESULT_MENU_SELECT_7,
SIMCONNECT_TEXT_RESULT_MENU_SELECT_8,
SIMCONNECT_TEXT_RESULT_MENU_SELECT_9,
SIMCONNECT_TEXT_RESULT_MENU_SELECT_10,
SIMCONNECT_TEXT_RESULT_DISPLAYED =0x00010000,
SIMCONNECT_TEXT_RESULT_QUEUED,
SIMCONNECT_TEXT_RESULT_REMOVED,
SIMCONNECT_TEXT_RESULT_REPLACED,
SIMCONNECT_TEXT_RESULT_TIMEOUT
};
Members
SIMCONNECT_TEXT_RESULT_MENU_SELECT_1 to SIMCONNECT_TEXT_RESULT_MENU_SELECT_10
Specifies that the user has selected the menu item.
SIMCONNECT_TEXT_RESULT_DISPLAYED
Specifies that the menu or text identified by the EventID is now on display.
SIMCONNECT_TEXT_RESULT_QUEUED
Specifies that the menu or text identified by the EventID is waiting in a queue.
SIMCONNECT_TEXT_RESULT_REMOVED
Specifies that the menu or text identified by the EventID has been removed from the queue.
SIMCONNECT_TEXT_RESULT_REPLACED
Specifies that the menu or text identified by the EventID has been replaced in the queue.
SIMCONNECT_TEXT_RESULT_TIMEOUT
Specifies that the menu or text identified by the EventID has timed-out and is no longer on display.
Reference Sample
Primary sample | Text Menu |
Remarks
See the remarks for SimConnect_Text.
See Also
SIMCONNECT_TEXT_TYPE
The SIMCONNECT_TEXT_TYPE enumeration type is used to specify which type of text is to be displayed by the SimConnect_Text function
Syntax
enum SIMCONNECT_TEXT_TYPE{
SIMCONNECT_TEXT_TYPE_SCROLL_BLACK,
SIMCONNECT_TEXT_TYPE_SCROLL_WHITE,
SIMCONNECT_TEXT_TYPE_SCROLL_RED,
SIMCONNECT_TEXT_TYPE_SCROLL_GREEN,
SIMCONNECT_TEXT_TYPE_SCROLL_BLUE,
SIMCONNECT_TEXT_TYPE_SCROLL_YELLOW,
SIMCONNECT_TEXT_TYPE_SCROLL_MAGENTA,
SIMCONNECT_TEXT_TYPE_SCROLL_CYAN,
SIMCONNECT_TEXT_TYPE_PRINT_BLACK = 0x0100,
SIMCONNECT_TEXT_TYPE_PRINT_WHITE,
SIMCONNECT_TEXT_TYPE_PRINT_RED,
SIMCONNECT_TEXT_TYPE_PRINT_GREEN,
SIMCONNECT_TEXT_TYPE_PRINT_BLUE,
SIMCONNECT_TEXT_TYPE_PRINT_YELLOW,
SIMCONNECT_TEXT_TYPE_PRINT_MAGENTA,
SIMCONNECT_TEXT_TYPE_PRINT_CYAN,
SIMCONNECT_TEXT_TYPE_MENU = 0x200
};
Members
SIMCONNECT_TEXT_TYPE_SCROLL_BLACK to SIMCONNECT_TEXT_TYPE_SCROLL_CYAN
Specifies scrolling text in the named color.
SIMCONNECT_TEXT_TYPE_PRINT_BLACK to SIMCONNECT_TEXT_TYPE_PRINT_CYAN
Specifies static text in the named color.
SIMCONNECT_TEXT_TYPE_MENU
Specifies that the text is for a menu.
Reference Sample
Primary sample | Text Menu |
Remarks
See the remarks for SimConnect_Text.
See Also
SIMCONNECT_WAYPOINT_FLAGS
The SIMCONNECT_WAYPOINT_FLAGS enumeration type is used with the SIMCONNECT_DATA_WAYPOINT structure to define waypoints.
Syntax
enum SIMCONNECT_WAYPOINT_FLAGS{
SIMCONNECT_WAYPOINT_SPEED_REQUESTED = 0x04,
SIMCONNECT_WAYPOINT_THROTTLE_REQUESTED = 0x08,
SIMCONNECT_WAYPOINT_COMPUTE_VERTICAL_SPEED = 0x10,
SIMCONNECT_WAYPOINT_ALTITUDE_IS_AGL = 0x20,
SIMCONNECT_WAYPOINT_ON_GROUND = 0x00100000,
SIMCONNECT_WAYPOINT_REVERSE = 0x00200000,
SIMCONNECT_WAYPOINT_WRAP_TO_FIRST = 0x00400000,
};
Members
SIMCONNECT_WAYPOINT_SPEED_REQUESTEDSpecifies requested speed is valid.
SIMCONNECT_WAYPOINT_THROTTLE_REQUESTED
Specifies requested throttle percentage is valid.
SIMCONNECT_WAYPOINT_COMPUTE_VERTICAL_SPEED
Specifies that the vertical should be calculated to reach the required speed when crossing the waypoint.
SIMCONNECT_WAYPOINT_ALTITUDE_IS_AGL
Specifies the altitude specified is AGL (above ground level).
SIMCONNECT_WAYPOINT_ON_GROUND
Specifies the waypoint should be on the ground. Make sure this flag is set if the aircraft is to taxi to this point.
SIMCONNECT_WAYPOINT_REVERSE
Specifies that the aircraft should back up to this waypoint. This is only valid on the first waypoint.
SIMCONNECT_WAYPOINT_WRAP_TO_FIRST
Specifies that the next waypoint is the first waypoint. This is only valid on the last waypoint.
Reference Sample
Primary sample | AI Objects and Waypoints Managed AI Waypoints |
Remarks
To set multiple waypoint flags simply OR them together. See the remarks for the SIMCONNECT_DATA_WAYPOINT structure.
See Also
SIMCONNECT_WEATHER_MODE
The SIMCONNECT_WEATHER_MODE enumeration type is used to return the current weather mode, after a call using the SIMCONNECT_RECV_ID_EVENT_WEATHER_MODE setting
Syntax
enum SIMCONNECT_WEATHER_MODE{
SIMCONNECT_WEATHER_MODE_THEME,
SIMCONNECT_WEATHER_MODE_RWW,
SIMCONNECT_WEATHER_MODE_CUSTOM,
SIMCONNECT_WEATHER_MODE_GLOBAL
};
Members
SIMCONNECT_WEATHER_MODE_THEME
Specifies that the weather has been set to a theme.
SIMCONNECT_WEATHER_MODE_RWW
Specifies that real-world weather has been set.
SIMCONNECT_WEATHER_MODE_CUSTOM
Specifies that custom weather has been set.
SIMCONNECT_WEATHER_MODE_GLOBAL
Specifies that the global weather mode has been set.
See Also
Reference Samples
Reference sample code is coming soon for the FSW SDK, and final samples may be subject to change.
Reference Sample | Description | Highlighted Functions | Highlighted Structures or Enumerations |
Creates a number of AI objects, including an aircraft, a truck, a hot air balloon and a whale. A key press sends waypoints to the aircraft and truck. | |||
Creates a number of aircraft at Yakima Air Term/Mcallister airport and provides them with a flight plan to Spokane Intl. Fails to create a Boeing 747 because it is too large for the airport. Also sets up two parked aircraft, and a key press initiates them with the same flight plan. Make sure to move the flight plan included with this sample (IFR Yakima Air Term Mcallister to Spokane Intl.pln ) to the default Flight Sim World Files directory before running this sample. | SimConnect_AISetAircraftFlightPlan SimConnect_AICreateEnrouteATCAircraft SimConnect_AICreateParkedATCAircraft
| SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE SIMCONNECT_RECV_ASSIGNED_OBJECT_ID
| |
Request notifications of a simulation event, the applying of the user aircraft's brakes in this case. | SimConnect_MapClientEventToSimEvent SimConnect_AddClientEventToNotificationGroup SimConnect_SetNotificationGroupPriority
| SIMCONNECT_RECV_EVENT | |
Banks the user's view camera left and right in response to certain key presses. | SimConnect_CameraSetRelative6DOF SimConnect_MapInputEventToClientEvent |
| |
DialogBoxMode | Sets Dialog mode, displays a message box, then resets Dialog mode. | SIMCONNECT_RECV_SYSTEM_STATE | |
Uses text menus to select the options for retrieving facilities data, such as airports, VORs, NDBs etc. | SimConnect_RequestFacilitiesList | ||
Input Event | Applies the user aircraft brakes by pressing the Ctrl-Shift-U key combination. | SIMCONNECT_RECV_EVENT | |
Provides the input data from the joystick X and Y axis position, Z axis rotation, hat switch and slider. A key press selects each input option in turn. | SimConnect_MapClientEventToSimEvent SimConnect_AddClientEventToNotificationGroup SimConnect_MapInputEventToClientEvent
| SIMCONNECT_RECV_EVENT | |
Adds and removes a menu item. | SimConnect_AddClientEventToNotificationGroup
| SIMCONNECT_RECV_EVENT | |
Interfaces with a mission xml file to provide some additional processing to mission actions, and when missions are completed. | SimConnect_ExecuteMissionAction SimConnect_CompleteCustomMissionAction SimConnect_SubscribeToSystemEvent WaitForSingleObject | ||
Query the current state of Mission System objects. | |||
Similar to the Client Event sample, but written without a callback function. | SimConnect_GetNextDispatch | SIMCONNECT_RECV_EVENT | |
Simply opens and closes a connection with the SimConnect server. | |||
Request Data | Requests a small selection of data on the user's aircraft, including latitude, longitude and altitude. | ||
Requests that one of the three keys specified be reserved for this client. | SIMCONNECT_RECV_RESERVED_KEY | ||
Add, manipulate and remove static scenery objects. | |||
To be used in combination with Send Event B and Send Event C. Transmits custom events to the two other clients. | SimConnect_TransmitClientEvent SimConnect_MapClientEventToSimEvent | SIMCONNECT_RECV_EVENT | |
Receives custom events from Send Event A, at a higher priority than Send Event C. | SimConnect_MapClientEventToSimEvent | SIMCONNECT_RECV_EVENT | |
Receives custom events from Send Event A, at a lower priority than Send Event B. | SimConnect_MapClientEventToSimEvent | SIMCONNECT_RECV_EVENT | |
When a certain key is pressed, the position of the user aircraft is changed. | SimConnect_AddToDataDefinition SimConnect_MapClientEventToSimEvent | ||
Notifies the client when a FlightLoaded event has occurred. | SimConnect_SubscribeToSystemEvent | ||
Requests the vertical speed and pitot heat switch settings on the user aircraft, but only when this data changes. | |||
Displays and clears a text menu. | SimConnect_Text | ||
Controls the user aircraft throttle using two specified keys. | SimConnect_AddToDataDefinition SimConnect_MapClientEventToSimEvent |
| |
Stores information on each call to the server, so that any error caught by the server can easily be located by the client. Primarily useful for debugging rather than retail builds. | SimConnect_GetLastSentPacketID SimConnect_MapClientEventToSimEvent SimConnect_AddClientEventToNotificationGroup | ||
Extracts three variable length strings from a structure. | |||
Uses a Windows Event to improve the waiting time performance of a client. | CreateEvent WaitForSingleObject | SIMCONNECT_RECV_EVENT | |
New features in FSW | Demonstrates various new or changed features of SimConnect for FSW. | SimConnect_SubscribeToSystemEvent SimConnect_SceneryCreateObject SimConnect_SceneryRemoveObject SimConnect_SceneryDetectObject | |
Managed C# Code Samples |
|
| |
Managed AI Waypoints | Sends an array of waypoints to an Extra 300S, and a fuel truck. | SimConnect_AICreateSimulatedObject SimConnect_AICreateNonATCAircraft | |
Managed Client Event | Requests Pitot heat switch and Flaps events. | SimConnect_MapClientEventToSimEvent SimConnect_AddClientEventToNotificationGroup SimConnect_SetNotificationGroupPriority OnRecvEvent | |
Managed Data Request | Click a button to request the title, latitude, longitude and altitude of the user aircraft. | SimConnect_AddToDataDefinition RegisterDataDefineStruct OnRecvSimobjectDataBytype | SIMCONNECT_RECV_SIMOBJECT_DATA |
Managed Facilities Request | Provides buttons to request facility data for Airports, Waypoints, NDBs and VORs. | SimConnect_SubscribeToFacilities | |
Managed System Event | Requests 4 second and simulation state system notifications. | ||
New features in FSW | Demonstrates various new or changed features of SimConnect for FSW. | SimConnect_SubscribeToSystemEvent SimConnect_SceneryCreateObject SimConnect_SceneryRemoveObject SimConnect_SceneryDetectObject |