<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

  <style>
<!--
/* Style Definitions */
p,div
{mso-style-name:Text;
margin-top:0pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
li
{mso-style-name:Text;
margin-top:2pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.Link, div.link
{mso-style-name:Link;
margin-top:0pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
color:#3366FF;}
li.Link
{mso-style-name:Link;
margin-top:0pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
color:#3366FF;}
h1
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0pt;
margin-bottom:12.0pt;
margin-left:0pt;
text-align:left;
line-height:150%;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:2;
font-size:20.0pt;
font-family:Arial;
color:black;
mso-bidi-font-style:italic;}
h2
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0pt;
margin-bottom:12.0pt;
margin-left:0pt;
text-align:left;
line-height:150%;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:2;
font-size:18.0pt;
font-family:Arial;
color:#000033;
mso-bidi-font-style:italic;}
h3
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0pt;
margin-bottom:9.0pt;
margin-left:0pt;
text-align:left;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:3;
font-size:16.0pt;
mso-bidi-font-size:13.0pt;
font-family:Arial;
color:#0000cc;}
h4
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0pt;
margin-bottom:5.0pt;
margin-left:0pt;
text-align:left;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:3;
font-size:13.0pt;
mso-bidi-font-size:13.0pt;
font-family:Arial;
color:#00aa00;}
h5
{mso-style-next:Normal;
margin-top:3.0pt;
margin-right:0pt;
margin-bottom:3.0pt;
margin-left:0pt;
text-align:left;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:3;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:Arial;
color:#000000;}
h6
{mso-style-next:Normal;
margin-top:3.0pt;
margin-right:0pt;
margin-bottom:3.0pt;
margin-left:0pt;
text-align:left;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:3;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:Arial;
color:#aa0000;}
CODE
{mso-style-name:Code;
margin:0pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Courier New";
mso-fareast-font-family:"Courier New";
color:#000000;}
A:Hover
{color:#00aa00;}
BODY
{margin-left:30pt;
background:#f5f5f5;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
table
{class:T1;
style:border:medium none;
border-collapse:collapse;
border:5;
background-color:#FFFF99;
border-color:#CC0000;
border-style:inset;
width:670;
text-align:left;}
tr {vertical-align:top;}
.style1 {font-family: "Times New Roman"}
-->
  </style>
</head>


<body>
<img src="Images/fsx-bannercontrol.jpg" width="800" height="200"><br>

<h1><a name="SimConnect_SDK_Reference"></a>SimConnect
SDK Reference</h1>
<h2>Table of Contents</h2>
<ul>
  <li><a href="#Overview">Overview</a></li>
  <li><a href="#Setup">Setup</a></li>
  <li><a href="#SimConnect_API_Reference">SimConnect
    API Reference</a></li>
  <li><a href="#SimConnect_Structures_and_Enumerations">SimConnect
    Structures and Enumerations</a></li>
  <li><a href="#ProgrammingSimConnectClientsusingCsharp">Programming SimConnect Clients using C# </a></li>
  <li><a href="#WorkingSamples">Working Samples</a></li>
</ul>
<h2>Overview<a name="Overview"></a></h2>

The SimConnect SDK can be used by programmers to write add-on
components to Microsoft &reg; <i>Flight Simulator X</i>.
These components can be written
in C, C++, or, if the
managed API calls are being used, any Microsoft .NET lanaguge such as
C#.net or VB.net. Typically the components will perform one or more of the
following:<br>

<ul>

  <li>Add the processing for a new complex gauge, or other instrument, to
    <i>Flight Simulator</i>.</li>

  <li>Replace <i>Flight Simulator</i> processing of
one or more events with new logic.</li>

  <li>Record or monitor a flight.</li>

  <li>Extend the mission system of <i>Flight Simulator</i>.</li>

  <li>Create and set the flight plans for AI (non-user)  aircraft. </li>
  <li>Set different weather systems.</li>
  <li>Enable new hardware to work with 
  <i>Flight Simulator</i>.</li>
  <li>Control an additional camera that the user can optionally select to view. </li>
</ul>

<h2>Setup<a name="Setup"></a></h2>

<p>This section describes how to set up a development environment for SimConnect.</p>
<ul>
  <li><a href="#SimConnectProjects">SimConnect Projects</a></li>
  <li><a href="#Thesimconnectinifile">The SimConnect.ini file </a></li>
  <li><a href="#Thesimconnectcfgfile">The SimConnect.cfg file</a></li>
  <li><a href="#TheEXExmlandDLLxmlfiles">The EXE.xml and DLL.xml files</a></li>
  <li><a href="#TheSimConnectxmlfile">The SimConnect.xml file</a></li>
  <li><a href="#DesignConsiderations">Design Considerations </a></li>
</ul>
<h3>SimConnect Projects<a name="SimConnectProjects"></a></h3>
<p>To build SimConnect add-ons, you must use Microsoft &reg; Visual Studio 2005 or later,
  or Microsoft &reg; Visual  C++ 2005 Express Edition or later. To build the project make sure
you have completed the following steps.</p>
<h4>C/C++ Projects</h4>
<ol>

  <li>For C or C++ add-ons, start a new Win32 Console Application project if the add-on will have no user interface. Start a new Win32 Project  or MFC Application if the add-on will have a user interface.<br>
  </li>

  <li>Include the SimConnect.h header file.</li>
  <li>Link to the SimConnect.lib library, by adding <b>SimConnect.lib</b> to the Additional Options of the Command Line (see image below):
    <br>
    <br>
    <table width="400" border="1" cellspacing="2" cellpadding="4">
      <tr>
        <td><img src="Images/LibraryProperty.jpg"></td>
      </tr>
    </table>
    <br>
  </li>
  <li>Build the application using the function calls described in this document.</li>
</ol>

<h4>DLL Projects</h4>
<ol>
  <li>Create and add a definition file to the project. This is needed because SimConnect expects the exported names <b>DLLStart</b> and <b>DLLStop</b> to be undecorated (by default additional characters are added to these names). The definition file can be created by selecting <b>Project/Add New Item</b> from the main menu in Visual Studio. Edit the definition (.def) file so it  looks like this (where <i>DLL Project</i> is the name of your project):<br>
    <br>
      <table width="800" border="1" cellspacing="2" cellpadding="4">
        <tr>
          <td>LIBRARY	&quot;<i>DLL Project</i>&quot;<br>
            EXPORTS<br>
DLLStart<br>
DLLStop</td>
        </tr>
      </table>
    <br>
</li>
  <li>Confirm that the definition file has been added to the project by checking the <i>Linker\Input </i>properties:<br>
    <br>
    <br>
    <table width="800" border="1" cellspacing="2" cellpadding="4">
      <tr>
        <td><img src="Images/LinkerDefFile.JPG" width="749" height="521"></td>
      </tr>
    </table>
      <br>
  </li>
  <li>Pay particular attention to the remarks and working samples for <b><a href="#SimConnect_CallDispatch">SimConnect_CallDispatch</a></b>.</li>
</ol>
<h4>C#/.NET Projects</h4>
<ol>
  <li>For C#, or other .NET language add-ons, refer to the special section on <a href="#ProgrammingSimConnectClientsusingCsharp">Programming SimConnect Clients using C# </a>.</li>
  <li>Build the application using the function calls described in this document.</li>
</ol>
<h4>All Projects</h4>
<ol>
  <li>Ensure the <a href="#Thesimconnectinifile">SimConnect.ini</a> file is  in your <i>My Documents\Flight Simulator X Files</i> folder. You do not usually have to make any changes to this file. The SimConnect.ini file provided ensures that the SimConnect debug window opens to display communication information between the server and the clients.</li>
  <li>If the client is to work remotely, write a <a href="#Thesimconnectcfgfile">SimConnnect.cfg</a> file for it. </li>
  <li>Ensure the <a href="#TheEXExmlandDLLxmlfiles">EXE.xml, DLL.xml files</a> and <a href="#TheSimConnectxmlfile">SimConnect.xml </a>files are in the <i>&lt;Drive&gt;:\Documents and   Settings\&lt;alias&gt;\Application   Data\Microsoft\FSX</i> folder, and edit these files according to the instructions that follow.</li>
  <li>Run <i>Flight Simulator X</i> to test your SimConnect client. </li>
</ol>
<h3>The SimConnect.ini file<a name="Thesimconnectinifile"></a></h3>
<p>The 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 <i>My Documents\Flight Simulator X Files</i> folder.</p>
<p>&nbsp; </p>
<table width="800" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Directive</h5></td>
    <td><h5>Values</h5></td>
    <td><h5>Description</h5></td>
  </tr>
  <tr>
    <td><b>level</b></td>
    <td>Verbose, Normal, Warning, Error, Off </td>
    <td>Set the level of text communication to be provided to the console, debug string, or log file. </td>
  </tr>
  <tr>
    <td><b>console</b></td>
    <td>Yes, No </td>
    <td>Open a command line debug window to display server to client communication. </td>
  </tr>
  <tr>
    <td><b>OutputDebugString</b></td>
    <td>Yes, No </td>
    <td>Sends the output text to the Platform SDK OutputDebugString. Refer to MSDN documentation for more details </td>
  </tr>
  <tr>
    <td><b>file</b></td>
    <td>Filename</td>
    <td><p>Output communications to a log file. If the text %03u is included in the filename, then the filename will be incremented each time <i>Flight Simulator</i> starts, so giving a new log file for each test run.</p>
    <p>Example: file=c:\simconnect%03u.log  </p></td>
  </tr>
  <tr>
    <td><b>file_next_index</b></td>
    <td>Integer</td>
    <td>The index of the first log file. Subsequent log files will have the index number incremented by one. </td>
  </tr>
</table>
<p>&nbsp; </p>
<h3>The SimConnect.cfg file<a name="Thesimconnectcfgfile"></a></h3>
<p>The SimConnect.cfg file contains communications information for a client. This file is only required if a client is going to access <i>Flight Simulator</i> running on a remote machine, and should be placed in the <i>My Documents</i> folder, or in the same folder as the client application or library, on the computer the client is running on. Also make sure to run the SimConnect.msi installer on the remote client machine which installs the WinSxS library, found in the \lib folder.</p>
<p>&nbsp;</p>
<p>The SimConnect.cfg file can contain a number of configurations, identifed in sections with the [SimConnect.<i>N</i>] title. The index number is used as a parameter in the <a href="#SimConnect_Open">SimConnect_Open</a> function. This is useful for applications that communicate with a number of different machines that are running <i>Flight Simulator</i>. The default configuration index is zero, and if there is only one configuration in the file, no index number is required. <br>
</p>
<p>&nbsp;</p>
<table width="800" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Directive</h5></td>
    <td><h5>Values</h5></td>
    <td><h5>Description</h5></td>
  </tr>
  <tr>
    <td><b>Protocol</b></td>
    <td>IPv4, IPv6 </td>
    <td>Both protocols are available on computers running Microsoft Windows &reg;, with IPv4 as the default. IPv6 has more security features and is recommended. If IPv6 is not already installed, there is a utility to install it in the <i>SimConnect SDK\config folder</i>.</td>
  </tr>
  <tr>
    <td><p><b>Address</b></p>
    <p><b>Port</b></p></td>
    <td>&nbsp;</td>
    <td>The Address and Port of the SimConnect server should be entered in these fields, these will be the same values as those in the appropriate Comm section of the <a href="#TheSimConnectxmlfile">Simconnect.xml file</a>. A good knowledge of Windows networking and client/server applications will be needed to set these correctly. The address can be the name of a computer in a Domain Controller environment. </td>
  </tr>
  
  <tr>
    <td><b>MaxReceiveSize</b></td>
    <td>Integer</td>
    <td>The maximum packet size. The default is 8192. If the client receives a packet larger than this size, it will disconnect from the server. </td>
  </tr>
  <tr>
    <td><b>DisableNagle</b></td>
    <td>0, 1 </td>
    <td>Set to 1 to disable the Nagle packet optimization algorithms. </td>
  </tr>
</table>
<p>&nbsp;</p>
<h3>The EXE.xml and DLL.xml files<a name="TheEXExmlandDLLxmlfiles"></a></h3>
<p>These files contain all the clients that will be activated by <i>Flight Simulator X</i> on start up. EXE.xml should contain all the .exe appliication 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   <i>&lt;Drive&gt;:\Documents and   Settings\&lt;alias&gt;\Application   Data\Microsoft\FSX</i> folder.</p>
<p>&nbsp;</p>
<p>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: </p>
<p>&nbsp; </p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr class="T1">
    <td><h5>XML</h5></td>
    <td><h5>Description</h5></td>
  </tr>
  <tr class="T1">
    <td><b>&lt; Launch.Addon &gt; </b></td>
    <td> Add one Launch.Addon section for each client.</td>
  </tr>
  <tr class="T1">
    <td><b>&lt; Disabled &gt; False&lt; /Disabled &gt; </b></td>
    <td> Set to True to disable the client.</td>
  </tr>
  <tr class="T1">
    <td><b>&lt; Name &gt;<i>Your Client Name </i>&lt; /Name &gt;</b></td>
    <td> The client application or library name.</td>
  </tr>
  <tr class="T1">
    <td><b>&lt; Path &gt; <i>Path\Client.exe/.dll</i>&lt; /Path &gt; </b></td>
    <td><p>If the client is local, the path relative to the main <i>Microsoft Flight Simulator X </i>folder where the game is installed, and the client application or library name.</p>
      <p>&nbsp;</p>
      <p>If the client is remote, and a share on the remote machine   is accessible from the machine on which <i>Flight Simulator X</i> is running, the client will be  launched.</p>
      <p>&nbsp;</p>
      <p><B>Definition:</B>
        <!-- Fill in Definition -->
      UNC provides a naming convention for identifying   network resources. UNC names consist of three parts, a server name, a share   name, and an optional file path, that are combined using backslashes as follows:</p>
    <p><i>\\server\share\file_path</i></p></td>
  </tr>
  <tr class="T1">
    <td><b>&lt;CommandLine&gt;&lt; /CommandLine &gt; </b></td>
    <td>This applies to .exe files only. Provides a command line string to the application. </td>
  </tr>
  <tr class="T1">
    <td><b>&lt; /Launch.Addon &gt; </b></td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Sample DLL.xml file</h4>
<p>The 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 <b>&lt;Disabled&gt;</b> entry to <b>True</b>. If <b>&lt;ManualLoad&gt;</b> is set to <b>True</b>, then the user will be prompted with a dialog as to whether they would like the add-on to be loaded or not. </p>
<p>&nbsp; </p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;</p>
      <p>&lt;SimBase.Document Type=&quot;Launch&quot; version=&quot;1,0&quot;&gt;<br>
  &lt;Descr&gt;Launch&lt;/Descr&gt;<br>
  &lt;Filename&gt;dll.xml&lt;/Filename&gt;<br>
  &lt;Disabled&gt;False&lt;/Disabled&gt;<br>
  &lt;Launch.ManualLoad&gt;False&lt;/Launch.ManualLoad&gt;</p>
      <p><br>
  &lt;Launch.Addon&gt;<br>
  &lt;Name&gt;First addon&lt;/Name&gt;<br>
  &lt;Disabled&gt;False&lt;/Disabled&gt;<br>
  &lt;Path&gt;First Addon.dll&lt;/Path&gt;<br>
  &lt;/Launch.Addon&gt;</p>
      <p>&nbsp;</p>
      <p>&lt;Launch.Addon&gt;<br>
&lt;Name&gt;Second addon &lt;/Name&gt;<br>
&lt;Disabled&gt;True&lt;/Disabled&gt;<br>
&lt;Path&gt;Second Addon.dll&lt;/Path&gt;<br>
&lt;/Launch.Addon&gt;</p>
      <p><br>
  &lt;/SimBase.Document&gt;      </p></td>
  </tr>
</table>
<p>&nbsp;</p>
<h6>Note</h6>
<p>All that including a file in the EXE.xml or DLL.xml file does is ensure that it starts up along with <i>Flight Simulator</i> (as long as <b>Disabled</b> is set to <b>false</b>). It does not ensure that the program is terminated when the user exits from <i>Flight Simulator</i>, this has to be handled from within the client itself. For many 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 <i>Flight Simulator</i> is running or not. The two xml files are provided for convenience only, it is not a <i>requirement</i> for any client to be added to these files. </p>
<p>&nbsp;</p>
<h3>The SimConnect.xml file<a name="TheSimConnectxmlfile"></a></h3>
<p>This file contains communication information for the SimConnect server. Normally it will not need to be changed, but the following table describes the format for the cases where changes may be necessary (usually involving remote connections). The file should be placed in the  in the <i>&lt;Drive&gt;:\Documents and   Settings\&lt;alias&gt;\Application   Data\Microsoft\FSX</i> folder on the computer the server is running on.</p>
<p>&nbsp;</p>
<table class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>XML</h5></td>
    <td><h5>Values</h5></td>
    <td><h5>Description</h5></td>
  </tr>
  <tr>
    <td><b>&lt; SimBase.Document Type=&quot;SimConnect&quot; version=&quot;1,0&quot; &gt; </b></td>
    <td>String</td>
    <td>SimConnect version information.</td>
  </tr>
  <tr>
    <td><b>&lt; Descr &gt; SimConnect&lt; /Descr &gt; </b></td>
    <td>String</td>
    <td>Description of this file. </td>
  </tr>
  <tr>
    <td><b>&lt; Filename &gt; SimConnect.xml&lt; /Filename &gt; </b></td>
    <td>String</td>
    <td>This filename.</td>
  </tr>
  <tr>
    <td><b>&lt; Disabled &gt; False&lt; /Disabled &gt; </b></td>
    <td>True, False </td>
    <td>Set to True to disable SimConnect completely. </td>
  </tr>
  
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>&lt; SimConnect.Comm &gt; </b></td>
    <td>&nbsp;</td>
    <td>Communications section. If remote connections are required, then additional SimConnect.Comm sections should be added, one for each protocol or scope that should be supported. </td>
  </tr>
  <tr>
    <td><b>&lt; Disabled &gt; False&lt; /Disabled &gt; </b></td>
    <td>True, False </td>
    <td>Set to True to disable this communication section. </td>
  </tr>
  <tr>
    <td><b>&lt; Protocol &gt; Auto&lt; /Protocol &gt; </b></td>
    <td>Auto, IPv4, IPv6</td>
    <td>IPv6 is selected by an Auto setting in preference to IPv4. </td>
  </tr>
  <tr>
    <td><b>&lt; Scope &gt; local&lt; /Scope &gt; </b></td>
    <td><p>local,</p>
    <p>global,</p>
    <p>link-local,</p>
    <p>unrestricted</p></td>
    <td><p>For IPv4, one of local or global. For IPv6, one of  local, link-local, global, or unrestricted. Link-local is an IPv6 mechanism for accessing computers on a network that does not involve traversing a router. Unrestriced enables Teredo tunneling. Refer to IPv4 and IPv6 documentation for more details. </p>      </td>
  </tr>
  <tr>
    <td><p><b>&lt; Address &gt; &lt; /Address &gt;</b></p>
      <p><b>&lt; Port &gt; &lt; /Port &gt;</b></p>
    <p>&nbsp;</p></td>
    <td>&nbsp;</td>
    <td>The server address and port. These should be copied to the identically named fields in the <a href="#Thesimconnectcfgfile">SimConnect.cfg files</a> for the clients. </td>
  </tr>
  <tr>
    <td><b>&lt; MaxClients &gt;&lt; /MaxClients &gt; </b></td>
    <td>Integer</td>
    <td>Define the maximum number of SimConnect clients that can be active at any one time, using this communication section. </td>
  </tr>
  
  <tr>
    <td><b>&lt; MaxRecvSize &gt;&lt; /MaxRecvSize &gt; </b></td>
    <td>Integer</td>
    <td>The maximum receive packet size, in bytes. The server will disconnect a client that transmits a packet  larger than this. </td>
  </tr>
  <tr>
    <td><b>&lt; DisableNagle &gt; True&lt; /DisableNagle &gt; </b></td>
    <td><p>True,</p>
    <p>False</p></td>
    <td>Set to True to disable the Nagle packet sending algorithms. </td>
  </tr>
  <tr>
    <td><b>&lt; /SimConnect.Comm &gt; </b></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>&lt; /SimBase.Document &gt; </b></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<h3>Design Considerations<a name="DesignConsiderations"></a></h3>
<p>The design of a SimConnect add-on involves writing a client to
  communicate with a server running within <i>Flight Simulator</i>.
  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.<br>
  
  <br>
  
  The recommended method of writing an add-on is to build it
  out-of-process, as an applicaition (an .exe file) rather than
  in-process, as a library (a .dll file). This is because out-of-process
  applications provide more stability, if they crash they will typically
  will not crash <i>Flight Simulator</i>, and are easier to
  build, test and debug.
  Out-of-process also supports Managed code, and therefore applications
  can be written in .NET languages, with their rich support for objects
and ease of building the UI. SimConnect clients are not currently thread-safe. </p>
<p>&nbsp;</p>
<p>Only one version of <i>Flight Simulator</i> 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 <i>Flight Simulator</i>, running on a network.</p>
<p>&nbsp;</p>
<p>The SimConnect client library used by <i>Flight Simulator </i>will be located in the WinSxS (side-by-side) folder. As new versions of the client library are released, they too will be placed in this folder, alongside and not replacing previous versions. This means that add-ons written for  older versions of SimConnect will still run as newer versions are released. </p>
<p>&nbsp;</p>
<p>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.</p>
<p>&nbsp;</p>
<p>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 modelling of the gauges of an aircraft between versions of <i>Flight Simulator</i> that might change some of the sequences. For example, the operation of the overhead start switch and fuel cut-off switch for jet engines has been modified since  <i>Flight Simulator</i> 2004. The Learning Center, accessible from the main menu of <i>Flight Simulator</i>, includes a huge amount of useful information on controlling airccraft within the simulator. </p>
<p>&nbsp;</p>
<p>SimConnect clients will not work with any previous version of <i>Flight Simulator</i>.</p>
<h2><a name="SimConnect_API_Reference"></a>SimConnect
API Reference</h2>

This section lists all the API functions, structures, enumerations, and
other coding information necessary to build SimConnect clients.<br>

<br>

<p>Information on each API call includes some example code.
  This code does not form a complete program in any sense, but simply
highlights the uses of the API call. The Working Samples sections list runnable sample code.</p>
<br>

<table border="10" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Function</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>
      <td><h6>General Functions </h6></td>
      <td>&nbsp;</td>
    </tr>
    <tr>

      <td><a href="#DispatchProc"><b>DispatchProc</b></a></td>

      <td>
      <p>Written by the developer of the SimConnect client, as a
callback function to handle all the communications with the server</p>      </td>
    </tr>

    <tr>
      <td><a href="#SimConnect_AddClientEventToNotificationGroup"><b>SimConnect_AddClientEventToNotificationGroup</b></a></td>
      <td><p>Used to add an individual client defined event to a
        notification group.</p></td>
    </tr>
    <tr>
      <td><A HREF="#SimConnect_AddToClientDataDefinition"><B>SimConnect_AddToClientDataDefinition</B></A></td>
      <td>Used to add an offset and a size in bytes, to a client data definition.</td>
    </tr>
    <tr>
      <td><a href="#SimConnect_AddToDataDefinition"><b>SimConnect_AddToDataDefinition</b></a></td>
      <td><p> Used to add a <i>Flight Simulator</i> simulation variable name to a client defined object definition.</p></td>
    </tr>
    <tr>
      <td><a href="#SimConnect_CallDispatch"><b>SimConnect_CallDispatch</b></a></td>
      <td><p>Used to&nbsp;process the next SimConnect message
        received
        through the specified callback function.</p></td>
    </tr>
    <tr>
      <td><A HREF="#SimConnect_ClearClientDataDefinition"><B>SimConnect_ClearClientDataDefinition</B></A></td>
      <td>Used to clear the definition of the specified client data.</td>
    </tr>
    <tr>
      <td><a href="#SimConnect_ClearDataDefinition"><b>SimConnect_ClearDataDefinition</b></a></td>
      <td><p>Used to remove all simulation variables from a client
        defined object.</p></td>
    </tr>
    
    <tr>
      <td><a href="#SimConnect_ClearInputGroup"><b>SimConnect_ClearInputGroup</b></a></td>
      <td><p>Used to remove all the input events from a specified
        input group object.</p></td>
    </tr>
    <tr>
      <td><a href="#SimConnect_ClearNotificationGroup"><b>SimConnect_ClearNotificationGroup</b></a></td>
      <td><p>Used to remove all the client defined events from a
        notification group.</p></td>
    </tr>
    <tr>

      <td><a href="#SimConnect_Close"><b>SimConnect_Close</b></a></td>

      <td>
      <p>Used to request that the communication with the server
is ended.</p>      </td>
    </tr>

    <tr>
      <td><A HREF="#SimConnect_CreateClientData"><B>SimConnect_CreateClientData</B></A></td>
      <td>Used to request the creation of a reserved data area for this client.</td>
    </tr>
    <tr>
      <td><A HREF="#SimConnect_FlightLoad"><B>SimConnect_FlightLoad</B></A></td>
      <td>Used to load an existing flight file. </td>
    </tr>
    <tr>
      <td><A HREF="#SimConnect_FlightPlanLoad"><B>SimConnect_FlightPlanLoad</B></A></td>
      <td>Used to load an existing flight plan. </td>
    </tr>
    <tr>
      <td><A HREF="#SimConnect_FlightSave"><B>SimConnect_FlightSave</B></A></td>
      <td>Used to save the current state of a flight to a flight file. </td>
    </tr>
    <tr>
      <td><a href="#SimConnect_GetLastSentPacketID"><b>SimConnect_GetLastSentPacketID</b></a></td>
      <td><p>Returns the ID of the last packet sent to the SimConnect
        server.</p></td>
    </tr>
    <tr>
      <td><a href="#SimConnect_GetNextDispatch"><b>SimConnect_GetNextDispatch</b></a></td>
      <td><p>Used
        to&nbsp;process the next SimConnect message  received,
        without the
        use of a callback function.</p></td>
    </tr>
    <tr>
      <td><b><a href="#SimConnect_MapClientDataNameToID">SimConnect_MapClientDataNameToID</a></b></td>
      <td>Used to associate an ID with a named client date area. </td>
    </tr>
    <tr>

      <td><a href="#SimConnect_MapClientEventToSimEvent"><b>SimConnect_MapClientEventToSimEvent</b></a></td>

      <td>
      <p>Used to associate a client defined event ID with a <i>Flight
Simulator</i> event name.</p>      </td>
    </tr>

    <tr>
      <td><a href="#SimConnect_MapInputEventToClientEvent"><b>SimConnect_MapInputEventToClientEvent</b></a></td>
      <td><p>Used to connect input events (such as keystrokes,
        joystick or mouse
        movements) with the sending of appropriate event notifications.</p></td>
    </tr>
    
    <tr>
      <td><a href="#SimConnect_Open"><b>SimConnect_Open</b></a></td>
      <td><p>Used to send a request to the <i>Flight Simulator</i> server to open up
        communications with a new client.</p></td>
    </tr>
    <tr>
      <td><a href="#SimConnect_RemoveClientEvent"><b>SimConnect_RemoveClientEvent</b></a></td>
      <td><p>Used to remove a client defined event from a notification group.</p></td>
    </tr>
    <tr>
      <td><a href="#SimConnect_RemoveInputEvent"><b>SimConnect_RemoveInputEvent</b></a></td>
      <td><p>Used to remove an input event from a specified
        input group object.</p></td>
    </tr>
    <tr>
      <td><A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A></td>
      <td> Used to request that the data in an area created by another client be sent to this client.</td>
    </tr>
    <tr>
      <td><a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a></td>
      <td><p>Used to request when the SimConnect client is to receive
        data values
        for a specific&nbsp;object.</p></td>
    </tr>
    <tr>
      <td><a href="#SimConnect_RequestDataOnSimObjectType"><b>SimConnect_RequestDataOnSimObjectType</b></a></td>
      <td><p>Used to retrieve informtion&nbsp;about simulation
        objects of a given type that are within a specifed radius of the
        user's aircraft.</p></td>
    </tr>
    <tr>
      <td><b><a href="#SimConnect_RequestNotificationGroup">SimConnect_RequestNotificationGroup</a></b></td>
      <td>Used to request events are transmitted from a notification group, when the simulation is in Dialog Mode. </td>
    </tr>
    <tr>
      <td><A HREF="#SimConnect_RequestReservedKey"><B>SimConnect_RequestReservedKey</B></A></td>
      <td><p> Used to request a specific keyboard TAB-key combination applies only to this client.</p></td>
    </tr>
    <tr>
      <td><b><a href="#SimConnect_RequestSystemState">SimConnect_RequestSystemState</a></b></td>
      <td>Used to request information from a number of <i>Flight Simulator</i> system components. </td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><A HREF="#SimConnect_SetClientData"><B>SimConnect_SetClientData</B></A></td>
      <td align="undefined" valign="undefined">Used to write one or more units of data to a client data area.</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><a href="#SimConnect_SetDataOnSimObject"><span style="font-weight: bold;">SimConnect_SetDataOnSimObject</span></a></td>
      <td align="undefined" valign="undefined"> Used to make changes to the data properties of an object.</td>
    </tr>
    
    <tr>
      <td><a href="#SimConnect_SetInputGroupPriority"><b>SimConnect_SetInputGroupPriority</b></a></td>
      <td><p>Used to set the priority for a specified input group
        object.</p></td>
    </tr>
    <tr>
      <td><a href="#SimConnect_SetInputGroupState"><b>SimConnect_SetInputGroupState</b></a></td>
      <td><p>Used to&nbsp;turn requests for input event
        information from the server on and off.</p></td>
    </tr>
    <tr>
      <td><a href="#SimConnect_SetNotificationGroupPriority"><b>SimConnect_SetNotificationGroupPriority</b></a></td>
      <td><p>Used to set the priority of a notification group.</p></td>
    </tr>
    <tr>
      <td><a href="#SimConnect_SetSystemEventState"><b>SimConnect_SetSystemEventState</b></a></td>
      <td><p>Used to turn requests for event information from the
        server on and off.</p></td>
    </tr>
    <tr>
      <td><a href="#SimConnect_SetSystemState"><b>SimConnect_SetSystemState</b></a></td>
      <td align="undefined" valign="undefined">Used to access a number of <i>Flight Simulator</i> system components. </td>
    </tr>
    <tr>
      <td><a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a> </td>
      <td align="undefined" valign="undefined">Used to request that a specific system event is notified to
        the client.</td>
    </tr>
    
    <tr>

      <td><a href="#SimConnect_TransmitClientEvent"><b>SimConnect_TransmitClientEvent</b></a></td>

      <td>
      <p>Used
to request that the <i>Flight Simulator</i> server
transmit to all SimConnect clients  the specified client event.</p>      </td>
    </tr>

    <tr>

      <td> <a href="#SimConnect_UnsubscribeFromSystemEvent"><b>SimConnect_UnsubscribeFromSystemEvent</b></a>      </td>

      <td align="undefined" valign="undefined">Used
to request that notifications are no longer received for the specified
system event.</td>
    </tr>
    <tr>
      <td><h6>Helper Functions </h6></td>
      <td>&nbsp;</td>
    </tr>
    <tr>

      <td><a href="#SimConnect_InsertString"><b>SimConnect_InsertString</b></a></td>

      <td>
      <p>Used to assist in adding variable length strings to a structure. </p>      </td>
    </tr>
    <tr>
      <td><a href="#SimConnect_RequestResponseTimes"><b>SimConnect_RequestResponseTimes</b></a></td>
      <td>Used to
        provide some data on the performance of the client-server connection</td>
    </tr>
	
	<tr>
      <td><a href="#SimConnect_RetrieveString"><b>SimConnect_RetrieveString</b></a></td>
	  <td><p>Used to assist in retrieving varaible length strings from a structure. </p></td>
    </tr>
	<tr>
      <td><h6>AI Object Specific Functions </h6></td>
      <td>&nbsp;</td>
    </tr>
<tr><td><A HREF="#SimConnect_AICreateEnrouteATCAircraft"><B>SimConnect_AICreateEnrouteATCAircraft</B></A></td><td><p>Used to create an AI controlled aircraft that is  about to start or is already underway on its flight plan.</p></td></tr>
<tr><td><A HREF="#SimConnect_AICreateNonATCAircraft"><B>SimConnect_AICreateNonATCAircraft</B></A></td><td><p>Used to create an aircraft that is not flying under ATC control (so is typically flying under VFR rules).</p></td></tr>
<tr><td><A HREF="#SimConnect_AICreateParkedATCAircraft"><B>SimConnect_AICreateParkedATCAircraft</B></A></td><td><p>Used to create an AI controlled aircraft that is currently parked and does not have a flight plan.</p></td></tr>
<tr><td><A HREF="#SimConnect_AICreateSimulatedObject"><B>SimConnect_AICreateSimulatedObject</B></A></td><td><p> Used to create AI controlled objects other than aircraft.</p></td></tr>
<tr>
  <td><A HREF="#SimConnect_AIReleaseControl"><B>SimConnect_AIReleaseControl</B></A></td>
  <td><p>Used to clear the AI control of a simulated object, typically an aircraft, in order for it to be controlled by a SimConnect client.</p></td>
</tr>
<tr><td><A HREF="#SimConnect_AIRemoveObject"><B>SimConnect_AIRemoveObject</B></A></td>
  <td>Used to remove any object created by the client using one of the  AI creation functions.</td>
</tr>
<tr><td><A HREF="#SimConnect_AISetAircraftFlightPlan"><B>SimConnect_AISetAircraftFlightPlan</B></A></td><td><p>Used to set or change the flight plan of an AI controlled aircraft. </p></td></tr>
  
  <tr>
    <td><h6>Camera Specific Functions </h6></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><A HREF="#SimConnect_CameraSetRelative6DOF"><B>SimConnect_CameraSetRelative6DOF</B></A></td>
    <td>Used to adjust the user's aircraft view camera.</td>
  </tr>
  <tr>
    <td><h6>Menu Specific Functions </h6></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><A HREF="#SimConnect_MenuAddItem"><B>SimConnect_MenuAddItem</B></A></td>
    <td><p>Used to add a menu item, associated with a client event.</p></td>
  </tr>
  <tr>
    <td><a href="#SimConnect_MenuAddSubItem"><b>SimConnect_MenuAddSubItem</b></a></td>
    <td>Used to add a sub-menu item, associated with a client event.</td>
  </tr>
  <tr>
    <td><A HREF="#SimConnect_MenuDeleteItem"><B>SimConnect_MenuDeleteItem</B></A></td>
    <td><p>Used to remove a client defined menu item. </p></td>
  </tr>
  <tr>
    <td><A HREF="#SimConnect_MenuDeleteSubItem"><B>SimConnect_MenuDeleteSubItem</B></A></td>
    <td>Used to remove a specifed sub-menu item.</td>
  </tr>
  <tr>
      <td><h6>Mission Specific Functions </h6></td>
      <td>&nbsp;</td>
    </tr>
    <tr><td><A HREF="#SimConnect_CompleteCustomMissionAction"><B>SimConnect_CompleteCustomMissionAction</B></A></td><td><p>Used to complete the mission action specified by a GUID. </p></td></tr>
<tr><td><A HREF="#SimConnect_ExecuteMissionAction"><B>SimConnect_ExecuteMissionAction</B></A></td><td><p>Used to execute the mission action specified by a GUID. </p></td></tr>
 
 
    <tr>
      <td><h6>Weather Specific Functions </h6></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><A HREF="#SimConnect_WeatherCreateStation"><B>SimConnect_WeatherCreateStation</B></A></td>
      <td>Used to add a weaher station. </td>
    </tr>
    <tr><td><A HREF="#SimConnect_WeatherCreateThermal"><B>SimConnect_WeatherCreateThermal</B></A></td><td><p>Used to create a thermal at a specific location. </p></td></tr>
    <tr>
      <td><A HREF="#SimConnect_WeatherRemoveStation"><B>SimConnect_WeatherRemoveStation</B></A></td>
      <td>Used to remove a weather station. </td>
    </tr>
    <tr><td><A HREF="#SimConnect_WeatherRemoveThermal"><B>SimConnect_WeatherRemoveThermal</B></A></td><td><p>Used to remove a thermal. </p></td></tr>
<tr>
  <td><a href="#SimConnect_WeatherRequestCloudState"><b>SimConnect_WeatherRequestCloudState</b></a></td>
  <td>Used to request cloud density information on a given area. </td>
</tr>

    <tr>

      <td><a href="#SimConnect_WeatherRequestInterpolatedObservation"><b>SimConnect_WeatherRequestInterpolatedObservation</b></a></td>

      <td>
      <p>Used to send a request for weather data that is
interpolated from the weather at the nearest weather stations.</p>      </td>
    </tr>
    <tr>

      <td><a href="#SimConnect_WeatherRequestObservationAtNearestStation"><b>SimConnect_WeatherRequestObservationAtNearestStation</b></a></td>

      <td>
      <p>Used to send a request for the weather data from the
weather station nearest to the specified lat/lon position.&nbsp;</p>      </td>
    </tr>

    <tr>

      <td><a href="#SimConnect_WeatherRequestObservationAtStation"><b>SimConnect_WeatherRequestObservationAtStation</b></a></td>

      <td>
      <p>Used to send a request for the weather data from a
weather station identified by
its ICAO code.</p>      </td>
    </tr>

    <tr>
      <td><A HREF="#SimConnect_WeatherSetDynamicUpdateRate"><B>SimConnect_WeatherSetDynamicUpdateRate</B></A></td>
      <td>Used to set the rate at which cloud formations change.</td>
    </tr>
    <tr>
      <td><a href="#SimConnect_WeatherSetModeCustom"><b>SimConnect_WeatherSetModeCustom</b></a></td>
      <td>Used to set the weather mode to user-defined.</td>
    </tr>
    <tr>
      <td><a href="#SimConnect_WeatherSetModeGlobal"><b>SimConnect_WeatherSetModeGlobal</b></a></td>
      <td>Used top set the weather mode to global, so the same weather data is used everywhere.</td>
    </tr>
    <tr>
      <td><a href="#SimConnect_WeatherSetModeServer"><b>SimConnect_WeatherSetModeServer</b></a></td>
      <td>Used to switch to a local server for weather observation data.</td>
    </tr>
    <tr>
      <td><a href="#SimConnect_WeatherSetModeTheme"><b>SimConnect_WeatherSetModeTheme</b></a></td>
      <td>Used to set the weather mode to a particular theme. </td>
    </tr>
    <tr>
      <td><a href="#SimConnect_WeatherSetObservation"><b>SimConnect_WeatherSetObservation</b></a></td>
      <td><p>Used to set the weather at a specific weather station, identified from within the Metar data string</p></td>
    </tr>
  </tbody>
</table>

<br>

<hr>
<h2>General Functions<a name="GeneralFunctions"></a><br>

  <a name="DispatchProc"></a></h2>
<h3>DispatchProc</h3>

<p>The <b>DispatchProc</b> function is a written by
the developer of the SimConnect client, as a callback function to
handle all the communications with the server.</p>

<h4>Syntax</h4>

<code><b>void CALLBACK DispatchProc(</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV*</b>&nbsp;&nbsp;<i>pData</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>cbData</i><br>
&nbsp;&nbsp;<b>void *</b>&nbsp;&nbsp;<i>pContext</i><br>
<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>pData</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to a data
buffer, to be treated initially as&nbsp;a&nbsp;<a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a>
structure. If you are going to make a copy of the data buffer (which is
maintained by the SimConnect client library) make sure that the defined
buffer is large enough (the size of the returned data structure is one
member of the <a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a>
structure.<br>

<i>cbData</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;The size of the data
buffer, in bytes.</p>
<p><i>pContext</i> <br>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Contains the  pointer specified by the client in the&nbsp;<a href="#SimConnect_CallDispatch"><b>SimConnect_CallDispatch</b></a> function call. </p>
<h4>Return Values</h4>

<p>This function does not return a value.</p>

<h4>Example</h4>

<p><code><span style="font-weight: bold;">
  void CALLBACK MyDispatchProc(SIMCONNECT_RECV* pData, DWORD cbData)</span><br>
  
  { <br>
  &nbsp;&nbsp;switch(pData-&gt;dwID)<br>
  &nbsp;&nbsp;{ <br>
  &nbsp;&nbsp; &nbsp;case
  SIMCONNECT_RECV_ID_OPEN: <br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // enter code to
  handle SimConnect version information received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_OPEN">SIMCONNECT_RECV_OPEN</a>
  structure.<br>
  &nbsp;&nbsp; &nbsp;&nbsp; SIMCONNECT_RECV_OPEN *openData = (SIMCONNECT_RECV_OPEN*) pData;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
  
  <br>
  &nbsp;&nbsp; &nbsp;case
  SIMCONNECT_RECV_ID_EVENT: <br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // enter code to
  handle events
  received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a>
  structure.<br>
  &nbsp;&nbsp; &nbsp;&nbsp; SIMCONNECT_RECV_EVENT *evt =
  (SIMCONNECT_RECV_EVENT*) pData;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
  
  <br>
  &nbsp;&nbsp;&nbsp;&nbsp;case
  SIMCONNECT_RECV_ID_EVENT_FILENAME:<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // enter code to
  handle event filenames
  received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT_FILENAME">SIMCONNECT_RECV_EVENT_FILENAME</a><br>
  &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;// structure.<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  SIMCONNECT_RECV_EVENT_FILENAME *evt =
  (SIMCONNECT_RECV_EVENT_FILENAME*) pData;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
  
  <br>
  &nbsp;&nbsp;&nbsp;&nbsp;case
  SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE:<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // enter code to
  handle AI objects that have been added or removed, and 
  received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE">SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE</a><br>
  &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;// structure.<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE *evt =
  (SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE*) pData;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
  
  <br>
  &nbsp;&nbsp;&nbsp;&nbsp;case
  SIMCONNECT_RECV_ID_EVENT_FRAME:<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // enter code to
  handle frame data received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT_FRAME">SIMCONNECT_RECV_EVENT_FRAME</a><br>
  &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;// structure.<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  SIMCONNECT_RECV_EVENT_FRAME *evt =
  (SIMCONNECT_RECV_EVENT_FRAME*) pData;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
  
  <br>
  &nbsp;&nbsp;&nbsp;&nbsp;case
  SIMCONNECT_RECV_ID_SIMOBJECT_DATA:<br>
  &nbsp;&nbsp;&nbsp; &nbsp; // enter code to handle
  object data
  received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_SIMOBJECT_DATA">SIMCONNECT_RECV_SIMOBJECT_DATA</a>
  structure.<br>
  &nbsp;&nbsp;
  &nbsp;&nbsp;&nbsp;SIMCONNECT_RECV_SIMOBJECT_DATA
  *pObjData = (SIMCONNECT_RECV_SIMOBJECT_DATA*) pData;<br>
  &nbsp;&nbsp; &nbsp;&nbsp; break;<br>
  
  <br>
  &nbsp;&nbsp; &nbsp;case
  SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE:<br>
  &nbsp;&nbsp; &nbsp;&nbsp; // enter code to handle
  object data
  received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE">SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</a><br>
  &nbsp;&nbsp; &nbsp; &nbsp;// structure.<br>
  &nbsp;&nbsp; &nbsp;&nbsp;
  SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE
  *pObjData = (SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE*) pData; <br>
  &nbsp;&nbsp; &nbsp;&nbsp; break;<br>
  
  <br>
  &nbsp;&nbsp; &nbsp;case
  SIMCONNECT_RECV_ID_QUIT:<br>
  &nbsp;&nbsp; &nbsp;&nbsp; // enter code to handle
  exiting the
  application<br>
  &nbsp;&nbsp; &nbsp;&nbsp; break;<br>
  
  <br>
  &nbsp;&nbsp; &nbsp;case
  SIMCONNECT_RECV_ID_EXCEPTION:<br>
  &nbsp;&nbsp; &nbsp;&nbsp; // enter code to handle
  errors received
  in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EXCEPTION">SIMCONNECT_RECV_EXCEPTION</a>
  structure. <br>
  &nbsp;&nbsp; &nbsp;&nbsp; SIMCONNECT_RECV_EXCEPTION
  *except =
  (SIMCONNECT_RECV_EXCEPTION*) pData;<br>
  &nbsp;&nbsp; &nbsp;&nbsp; break;<br>
  
  <br>
  &nbsp;&nbsp; &nbsp;case
  SIMCONNECT_RECV_ID_WEATHER_OBSERVATION:<br>
  &nbsp; &nbsp; &nbsp; // enter tode to handle object data
  received in a </code><code><a style="font-weight: bold;" href="#SIMCONNECT_RECV_WEATHER_OBSERVATION">SIMCONNECT_RECV_WEATHER_OBSERVATION</a>
  structure.</code><br>
  
  <code>&nbsp;&nbsp; &nbsp;&nbsp;
  SIMCONNECT_RECV_WEATHER_OBSERVATION* pWxData =
  (SIMCONNECT_RECV_WEATHER_OBSERVATION*) pData;<br>
  &nbsp;&nbsp; &nbsp;&nbsp; const char* pszMETAR = (const
    char*) (pWxData+1);<br>
  &nbsp;&nbsp; &nbsp;&nbsp; break;<br>
    
  <br>
  &nbsp;&nbsp; &nbsp;// Enter similar case statements to handle the other types of data that can be received, including:<br>
  &nbsp;&nbsp; &nbsp;// SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID,<br>
  &nbsp;&nbsp; &nbsp;// SIMCONNECT_RECV_ID_RESERVED_KEY,<br>
&nbsp;&nbsp; &nbsp;// SIMCONNECT_RECV_ID_CUSTOM_ACTION<br>
&nbsp;&nbsp; &nbsp;// SIMCONNECT_RECV_ID_SYSTEM_STATE<br>
&nbsp;&nbsp; &nbsp;// SIMCONNECT_RECV_ID_CLOUD_STATE<br>
  <br>
  &nbsp;&nbsp; &nbsp;default:<br>
  &nbsp;&nbsp; &nbsp;&nbsp; // enter code to handle the
  case where
  an unexpected message is received<br>
  &nbsp;&nbsp; &nbsp;&nbsp; break;<br>
  &nbsp;&nbsp; }<br>
  } </code></p>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples  </h5></td>
    <td><p><a href="#ClientEvent">Client Event</a></p>
    <p><a href="#TrackingErrors">Tracking Errors </a></p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td>All but a few of the other <a href="#WorkingSamples">samples</a> implement this function. </td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Remarks</h4>
<p>This function can be named appropriately by the client
developer. The name of the function is passed to the client-side
library with the&nbsp;<a href="#SimConnect_CallDispatch"><b>SimConnect_CallDispatch</b></a>
function call. Handle all the
callback events in this function. If you do not wish to implement a
callback function use <a style="font-weight: bold;" href="#SimConnect_GetNextDispatch">SimConnect_GetNextDispatch</a>.</p>
<p>&nbsp;</p>
<p>To receive time based notifications, see the <a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a> function. To receive event based notifications see the <b><a href="#SimConnect_AddClientEventToNotificationGroup">SimConnect_AddClientEventToNotificationGroup</a></b> function. To send an event to be received by other clients, see the <b><a href="#SimConnect_TransmitClientEvent">SimConnect_TransmitClientEvent</a></b> function.</p>
<h4>See Also</h4>

<ul>

  <li><a href="#SimConnect_CallDispatch"><b>SimConnect_CallDispatch</b></a></li>

  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</ul>
<BR><HR><br>
<a name="SimConnect_AddClientEventToNotificationGroup"></a>
<h3>SimConnect_AddClientEventToNotificationGroup</h3>
<p>The <b>SimConnect_AddClientEventToNotificationGroup</b> function is
  used to add an individual client defined event to a notification group.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_AddClientEventToNotificationGroup(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_NOTIFICATION_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_CLIENT_EVENT_ID</b>&nbsp;&nbsp;<i>EventID</i><b>,</b><br>
&nbsp;&nbsp;<b>BOOL</b>&nbsp;&nbsp;<i>bMaskable
= FALSE</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>GroupID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  group. <br>
  <i>EventID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  event. <br>
  <i>bMaskable</i><br>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Boolean, <span style="font-weight: bold;">True</span> indicates that
  the event will be masked by this client and will not be transmitted to any more clients, possibly including <i>Flight Simulator</i> itself (if the priority of the client exceeds that of <i>Flight Simulator</i>). <b>False</b> is the
  default. See the explanation of <a href="#SimConnect_Priorities">SimConnect Priorities</a>.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code>static enum EVENT_ID {<br>
&nbsp; EVENT_1,<br>
&nbsp; EVENT_2<br>
&nbsp; EVENT_3<br>
}; <br>
static enum GROUP_ID {<br>
&nbsp; GROUP_1,<br>
};<br>
<span style="font-weight: bold;">hr =
SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_1, EVENT_1);</span><br style="font-weight: bold;">
<span style="font-weight: bold;">hr =
SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_1, EVENT_2);</span><br style="font-weight: bold;">
<span style="font-weight: bold;">hr =
SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_1, EVENT_3, TRUE);</span><br style="font-weight: bold;">
<span style="font-weight: bold;">hr =
SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP_1,
SIMCONNECT_GROUP_PRIORITY_HIGHEST);</span><br>
<br>
</code>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#ClientEvent">Client Event</a></p>
        <p><a href="#CockpitCamera">Cockpit Camera</a></p>
      <p><a href="#JoystickInput">Joystick Input</a></p>
      <p><a href="#MenuItems">Menu Items </a></p>
      <p><a href="#SendEventA">Send Event A </a></p>
      <p><a href="#SendEventB">Send Event B</a></p>
      <p><a href="#SendEventC">Send Event C</a></p>
      <p><a href="#TrackingErrors">Tracking Errors </a></p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td>Many  of the other <a href="#WorkingSamples">samples</a> implement this function. </td>
  </tr>
</table>
<h4>Remarks</h4>
<p>The maximum  number of events that can be added
  to a notfication group is 1000. A notification group is simply a convenient way of &nbsp;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.</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_RemoveClientEvent"><b>SimConnect_RemoveClientEvent</b></a></li>
  <li><a href="#SimConnect_SetNotificationGroupPriority"><b>SimConnect_SetNotificationGroupPriority</b></a></li>
  <li><a href="#SimConnect_ClearNotificationGroup"><b>SimConnect_ClearNotificationGroup</b></a></li>
</ul>
<HR>
<BR>
<A NAME="SimConnect_AddToClientDataDefinition"></A><H3>SimConnect_AddToClientDataDefinition</H3>
<p>The <B>SimConnect_AddToClientDataDefinition</B> function is used to add an offset and a size in bytes, to a client data definition.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_AddToClientDataDefinition(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_DATA_DEFINITION_ID</B>&nbsp;&nbsp;<I>DefineID</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwOffset</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwSize</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwReserved = SIMCONNECT_UNUSED</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect  object.
<BR>
<I>DefineID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client-defined
  client data definition.<BR>
<I>dwOffset</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing the offset into the client area, where the new addition is to start. <BR><I>dwSize</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Double word specifiying the size of the new addition, in bytes. 
<BR>
<I>dwReserved</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Reserved for future use.

</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>This 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.</p>
<p>&nbsp;</p>
<p>Whereas data definitions for client areas are defined in bytes, it is anticipated that most clients will write in specific data types, and cast appropriately when the data is received.</p>
<H4> See Also</H4>
<UL type="disc">

  <li><A HREF="#SimConnect_ClearClientDataDefinition"><B>SimConnect_ClearClientDataDefinition</B></A></li>
  <li><A HREF="#SimConnect_CreateClientData"><B>SimConnect_CreateClientData</B></A></li>
  <li><b><a href="#SimConnect_MapClientDataNameToID">SimConnect_MapClientDataNameToID</a></b></li>
  <li><A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A></li>
  <li><A HREF="#SimConnect_SetClientData"><B>SimConnect_SetClientData</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference </b></a> </li>
</UL>

<hr>
<a name="SimConnect_AddToDataDefinition"></a>
<h3>SimConnect_AddToDataDefinition</h3>
<p>The <b>SimConnect_AddToDataDefinition</b> function is used to add a <i>Flight Simulator</i> simulation variable name to a client defined object definition.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_AddToDataDefinition(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_DATA_DEFINITION_ID</b>&nbsp;&nbsp;<i>DefineID</i><b>,</b><br>
&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>DatumName</i><b>,</b><br>
&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>UnitsName</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE</b>&nbsp;&nbsp;<i>DatumType = SIMCONNECT_DATATYPE_FLOAT64</i><b>,</b><br>
&nbsp;&nbsp;<b>float</b>&nbsp;&nbsp;<i>fEpsilon = 0</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>DatumID = SIMCONNECT_UNUSED</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>DefineID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  data definition. <br>
  <i>DatumName</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the name of the <i>Flight Simulator</i> simulation variable.
  See the <a href="../Variables/Simulation Variables.html">Simulation Variables </a>document for a table of variable names. If
  an index is required then it should be appended to the variable name
  following a colon, see the example for DEFINITION_2 below. Indexes are
  numbered from 1 (not zero). Simulation variable names are not
  case-sensitive (so can be entered in upper or lower case).<br>
  <i>UnitsName</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the units of the
  variable. See the <a href="../Variables/Simulation Variables.html">Simulation Variables</a> document for a table of
  acceptable unit
  names. It is possible to specify different units to receive the data
  in, from those specified in the Simulation Variables document. See
  DEFINITION_2 below for an example. The alternative units must come
  under the same heading (such as Angular Velocity, or Volume, as
  specified in the Units of Measurement section of the Simulation
  Variables document).
  For strings and structures enter &quot;NULL&quot; for this parameter. <br>
  <i>DatumType</i><br>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;One member of the <a style="font-weight: bold;" href="#SIMCONNECT_DATATYPE">SIMCONNECT_DATATYPE</a> enumeration type. This parameter is used to determine what datatype should be used to return the data.  The default is <b>SIMCONNECT_DATATYPE_FLOAT64</b>. Note that the structure data types are legitimate parameters here. <br>
  <i>fEpsilon</i><br>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;If data is requested only when it changes (see the <i>flags</i> parameter of <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a>), a change will only be reported if it is greater than the value of this parameter. The default is zero, so even the tiniest change will initiate the transmission of data. Set this value appropriately so insignificant changes are not transmitted. This can  be used with integer data.<br>
  <i>DatumID</i><br>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies a client defined datum
  ID. The
  default is zero.
  Use this to identify the data received if the data is being returned in tagged format (see the <i>flags</i> parameter of <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a>). There is no need to specify datum IDs if the data is not being returned in tagged format. <br>
</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<p><code>static enum DATA_DEFINE_ID {<br>
  &nbsp; DEFINITION_1,<br>
  &nbsp; DEFINITION_2<br>
  };<br>
  <br>
  static enum DATA_REQUEST_ID {<br>
  &nbsp;&nbsp;&nbsp; REQUEST_1,<br>
  &nbsp;&nbsp;&nbsp; REQUEST_2,<br>
  };<br>
  <br>
  struct Struct1<br>
  {<br>
  &nbsp;&nbsp;&nbsp; double&nbsp; kohlsmann;<br>
  &nbsp;&nbsp;&nbsp; double&nbsp; altitude;<br>
  &nbsp;&nbsp;&nbsp; double&nbsp; latitude;<br>
  &nbsp;&nbsp;&nbsp; double&nbsp; longitude;<br>
  };<br>
  <br>
  // Match string definitions from the Simulation Variables document with
  the client defined ID<br>
    <br>
    <span style="font-weight: bold;">hr =
      SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1,
      "Kohlsman setting hg", "inHg");</span><br style="font-weight: bold;">
    <span style="font-weight: bold;">hr =
      SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1,
      "Indicated Altitude", "feet");</span><br style="font-weight: bold;">
    <span style="font-weight: bold;">hr =
      SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "Plane
      Latitude", "degrees");</span><br style="font-weight: bold;">
      <span style="font-weight: bold;">hr =
        SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "Plane
        Longitude", "degrees");</span><br style="font-weight: bold;">
      <br style="font-weight: bold;">
  </code><code style="font-weight: bold;"> hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_2,
    "GENERAL ENG RPM:1", "rpm");<br>
    hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_2,
  "</code><code style="font-weight: bold;">GENERAL ENG
    RPM:2</code><code style="font-weight: bold;">",
      "revolutions per minute");<br>
      hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_2, "</code><code style="font-weight: bold;">GENERAL
        ENG RPM:3</code><code style="font-weight: bold;">",
          "degrees per second");<br>
          hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_2, "</code><code style="font-weight: bold;">GENERAL
            ENG RPM:4</code><code style="font-weight: bold;">",
              "minutes per round");</code><br>
    <code><br>
      // Sections&nbsp;of code in DispatchProc<br>
  <br>
      // At the right point request the data<br>
      // In this example the data is being requested on the user aircraft<br>
      ....<br>
      hr  = SimConnect_RequestDataOnSimObject(hSimConnect, REQUEST_1, DEFINITION_1,</code> <code>SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_ONCE); <br>
  <br>
        ....<br>
        // When the data is received - cast it to the correct structure type <br>
  <br>
        case SIMCONNECT_RECV_ID_SIMOBJECT_DATA:<br>
        {<br>
  &nbsp;&nbsp;SIMCONNECT_RECV_SIMOBJECT_DATA *pObjData =
        (SIMCONNECT_RECV_SIMOBJECT_DATA*)pData;<br>
    <br>
  &nbsp;&nbsp;switch(pObjData-&gt;dwRequestID)<br>
  &nbsp;&nbsp;{<br>
  &nbsp;&nbsp; &nbsp;case REQUEST_1:<br>
  <br>
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;Struct1 *pS =
        (Struct1*)&amp;pObjData-&gt;dwData;<br>
  &nbsp;&nbsp;&nbsp; <br>
  &nbsp;&nbsp;&nbsp; &nbsp; // Add code to process the
        structure appropriately<br>
    <br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
  &nbsp; }<br>
        break;<br>
        }<br>
        ....<br>
</code></p>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#RequestData">Request Data </a></p>
        <p><a href="#SetData">Set Data </a></p>
      <p><a href="#TaggedData">Tagged Data</a></p>
      <p><a href="#ThrottleControl">Throttle Contol </a></p></td>
  </tr>
</table>
<h4>Remarks</h4>
<p>The maximum number of entries in a data definition is 1000.</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_ClearDataDefinition"><b>SimConnect_ClearDataDefinition</b></a></li>
  <li><a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a></li>
  <li><a href="#SimConnect_RequestDataOnSimObjectType"><b>SimConnect_RequestDataOnSimObjectType</b></a></li>
</ul>
<hr>
<br>
<a name="SimConnect_CallDispatch"></a>
<h3>SimConnect_CallDispatch</h3>
<p>The <b>SimConnect_CallDispatch</b> function is
  used to&nbsp;process the next SimConnect message received,
  through the specified callback function.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_CallDispatch(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>DispatchProc</b>&nbsp;&nbsp;<i>pfcnDispatch</i><b>,</b><br>
&nbsp;&nbsp;<b>void *</b>&nbsp;&nbsp;<i>pContext</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>pfcnDispatch</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the callback
  function. For a definition of the function see <a href="#DispatchProc"><b>DispatchProc</b></a>.<br>
  <i>pContext</i> <br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies a pointer that the client can define that will be returned in the callback. This is used in particular by managed code clients to pass a <i>this</i> pointer to the callback. </p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code> int quit = 0;<br>
....<br>
//<br>
while( quit == 0 )<br>
{<br>
&nbsp; <span style="font-weight: bold;">hr =
SimConnect_CallDispatch(hSimConnect, MyDispatchProc,
NULL);</span><br>
};<br>
<br>
</code>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#ClientEvent">Client Event</a></p>
        <p><a href="#TrackingErrors">Tracking Errors </a></p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td>All but a few of the other <a href="#WorkingSamples">samples</a> implement this function. </td>
  </tr>
</table>
<h4>Remarks</h4>
<p>It is important to call this function sufficiently frequently
  that
  the queue of information received from the server is processed
  (typically it is coded within a <span style="font-weight: bold;">while</span> 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:</p>
<p>&nbsp;</p>
<table class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><code> // Include files are no different than for an EXE<br>
          <br>
      HANDLE  hSimConnect = NULL;<br>
      <br>
      void CALLBACK MyDispatchProcDLL(SIMCONNECT_RECV* pData, DWORD cbData, void *pContext)<br>
      {<br>
      &nbsp;&nbsp;// Callback code for a DLL is no different than for an EXE <br>
      }<br>
      <br>
      // <br>
      // The DLLStart function must be present.<br>
      //<br>
      int __stdcall DLLStart(void)<br>
      {<br>
      &nbsp;&nbsp;HRESULT hr;<br>
      &nbsp;&nbsp;if (SUCCEEDED(SimConnect_Open(&amp;hSimConnect, &quot;DLL name&quot;, NULL, 0, NULL, 0)))<br>
      &nbsp;&nbsp;{<br>
      &nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;\nConnected to Flight Simulator&quot;);<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;// Place all initialization code for the client in this function<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<b>hr = SimConnect_CallDispatch(hSimConnect, MyDispatchProcDLL, NULL);</b><br>
      &nbsp;&nbsp;}<br>
      &nbsp;&nbsp;return 0;<br>
      }<br>
      <br>
      //<br>
      // The DLLStop function must be present.<br>
      //<br>
      void __stdcall DLLStop(void)<br>
      {<br>
      &nbsp;&nbsp;// Close the client<br>
      &nbsp;&nbsp;if (hSimConnect != NULL)<br>
      &nbsp;&nbsp;&nbsp;&nbsp;HRESULT hr = SimConnect_Close(hSimConnect);<br>
      }</code></td>
  </tr>
</table>
<p>&nbsp; </p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_GetNextDispatch"><b>SimConnect_GetNextDispatch</b></a></li>
</ul>
<br>
<hr>
<BR>
<A NAME="SimConnect_ClearClientDataDefinition"></A><H3>SimConnect_ClearClientDataDefinition</H3>
<p>The <B>SimConnect_ClearClientDataDefinition</B> function is used to clear the definition of the specified client data.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_ClearClientDataDefinition(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_DATA_DEFINITION_ID</B>&nbsp;&nbsp;<I>DefineID</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>DefineID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
client data definition. </p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>None.</p>
<H4>See Also</H4>
<UL type="disc">
  <li><A HREF="#SimConnect_AddToClientDataDefinition"><B>SimConnect_AddToClientDataDefinition</B></A></li>
  <li><A HREF="#SimConnect_CreateClientData"><B>SimConnect_CreateClientData</B></A></li>
  <li><b><a href="#SimConnect_MapClientDataNameToID">SimConnect_MapClientDataNameToID</a></b></li>
  <li><A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A></li>
  <li><A HREF="#SimConnect_SetClientData"><B>SimConnect_SetClientData</B></A></li>
  <LI><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference </b></a></li>
</UL>
<hr><br>
<a name="SimConnect_ClearDataDefinition"></a>
<h3>SimConnect_ClearDataDefinition</h3>
<p>The <b>SimConnect_ClearDataDefinition</b> function is used to remove all simulation variables from a client
  defined
  data definition.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_ClearDataDefinition(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_DATA_DEFINITION_ID</b>&nbsp;&nbsp;<i>DefineID</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>DefineID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  data definition.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code>static enum DATA_DEFINE_ID {<br>
&nbsp; DEFINITION_1,<br>
&nbsp; DEFINITION_2<br>
};<br>
....<br>
<br>
// Match string definitions from the Simulation Variables document with
the client defined ID<br>
<br>
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1,
"Kohlsman setting hg", "inHg");<br>
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1,
"Indicated Altitude", "feet");<br>
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "Plane
Latitude", "degrees");<br>
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "Plane
Longitude", "degrees");<br>
....<br>
<span style="font-weight: bold;">hr =
SimConnect_ClearDataDefinition(hSimConnect, DEFINITION_1);</span><br>
....<br>
</code>
<h4>Remarks</h4>
<p>Use this funtion to permanently delete a data definition. To temporarily suspend data requests see the remarks for the <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a> function .</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_AddToDataDefinition"><b>SimConnect_AddToDataDefinition</b></a></li>
  <li><a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a></li>
  <li><a href="#SimConnect_RequestDataOnSimObjectType"><b>SimConnect_RequestDataOnSimObjectType</b></a></li>
</ul>
<hr>
<br>
<a name="SimConnect_ClearInputGroup"></a>
<h3>SimConnect_ClearInputGroup</h3>
<p>The <b>SimConnect_ClearInputGroup</b> function
  is used to remove all the input events from a specified input
  group object.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_ClearInputGroup(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_INPUT_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>GroupID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  input group that is to have all its events removed.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code> static enum INPUT_ID {<br>
&nbsp; INPUT_1,<br>
};<br>
static enum EVENT_ID {<br>
&nbsp; EVENT_1,<br>
};<br>
hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_1, "parking_brakes");<br>
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1, "a+B", EVENT_1);<br>
....<br>
<span style="font-weight: bold;">hr =
SimConnect_ClearInputGroup(hSimConnect, INPUT_1);</span><br>
<br>
</code>
<h4>Remarks</h4>
<p>Use this function to permanently delete an input group. Use the <b><a href="#SimConnect_SetInputGroupState">SimConnect_SetInputGroupState</a></b> function to temporarily suspend input group notifications .</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_MapInputEventToClientEvent"><b>SimConnect_MapInputEventToClientEvent</b></a></li>
  <li><a href="#SimConnect_SetInputGroupPriority"><b>SimConnect_SetInputGroupPriority</b></a></li>
  <li><a href="#SimConnect_RemoveInputEvent"><b>SimConnect_RemoveInputEvent</b></a></li>
  <li><a href="#SimConnect_SetInputGroupState"><b>SimConnect_SetInputGroupState</b></a></li>
</ul>
<hr>
<br>
<a name="SimConnect_ClearNotificationGroup"></a>
<h3>SimConnect_ClearNotificationGroup</h3>
<p>The <b>SimConnect_ClearNotificationGroup</b> function is
  used to remove all the client defined events from a notification group.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_ClearNotificationGroup(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_NOTIFICATION_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>GroupID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  group that is to have all its events removed.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code>static enum EVENT_ID {<br>
&nbsp; EVENT_1,<br>
&nbsp; EVENT_2<br>
&nbsp; EVENT_3<br>
}; <br>
static enum GROUP_ID {<br>
&nbsp; GROUP_1,<br>
};<br>
hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_1, EVENT_1);<br>
hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_1, EVENT_2);<br>
hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_1, EVENT_3, TRUE);<br>
<br>
<span style="font-weight: bold;">hr =
SimConnect_ClearNotificationGroup(hSimConnect, GROUP_1);</span><br>
<br>
</code>
<h4>Remarks</h4>
<p>There 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. </p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_AddClientEventToNotificationGroup"><b>SimConnect_AddClientEventToNotificationGroup</b></a></li>
  <li><a href="#SimConnect_RemoveClientEvent"><b>SimConnect_RemoveClientEvent</b></a></li>
  <li><a href="#SimConnect_SetNotificationGroupPriority"><b>SimConnect_SetNotificationGroupPriority</b></a><br>
  </li>
</ul>
<hr><BR>

<a name="SimConnect_Close"></a>
<h3>SimConnect_Close</h3>

<p>The <b>SimConnect_Close</b> function is used to
request that the communication with the server is ended.</p>

<h4>Syntax</h4>

<code><b>HRESULT SimConnect_Close(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.</p>

<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. This should only happen if a the <i>hSimConnect</i> parameter is erroneous. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>

<code style="font-weight: bold;">hr =
SimConnect_Close(hSimConnect);</code>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#OpenandClose">Open and Close</a></p>
    <p><a href="#WindowsEvent">Windows Event</a></p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td>All  of the other <a href="#WorkingSamples">samples</a> implement this function. </td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Remarks</h4>
<p>When 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 explictiy in the client code.</p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a> </li>

  <li><a href="#SimConnect_Open"><b>SimConnect_Open</b></a></li>
</ul>

<BR><HR><BR>
<A NAME="SimConnect_CreateClientData"></A><H3>SimConnect_CreateClientData</H3>
<p>The <B>SimConnect_CreateClientData</B> function is used to request the creation of a reserved data area for this client.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_CreateClientData(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_DATA_ID</B>&nbsp;&nbsp;<I>ClientDataID</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwSize</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CREATE_CLIENT_DATA_FLAG</B>&nbsp;&nbsp;<I>Flags</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<CODE><I>ClientDataID</I></CODE><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;ID of the client data area. Before calling this function, call <b><a href="#SimConnect_MapClientDataNameToID">SimConnect_MapClientDataNameToID</a></b> to map an ID to a unique client  area name.<BR>
<I>dwSize</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing the size of the data area in bytes. <BR>
<I>Flags</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specify the flag <b>SIMCONNECT_CREATE_CLIENT_DATA_FLAG_READ_ONLY</b> if the data area can only be written to by this client (the client creating the data area). By default  other clients can write to this data area.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>Use 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 <A HREF="#SimConnect_AddToClientDataDefinition"><B>SimConnect_AddToClientDataDefinition</B></A> call, and set the actual values with a call to <A HREF="#SimConnect_SetClientData"><B>SimConnect_SetClientData</B></A>. Other clients can receive the data with a call to <A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A>.</p>
<p>&nbsp;</p>
<p>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. </p>
<H4>See Also</H4>
<UL type="disc">

  <li><A HREF="#SimConnect_AddToClientDataDefinition"><B>SimConnect_AddToClientDataDefinition</B></A></li>
  <li><A HREF="#SimConnect_ClearClientDataDefinition"><B>SimConnect_ClearClientDataDefinition</B></A></li>
  <li><A HREF="#SimConnect_CreateClientData"><B>SimConnect_CreateClientData</B></A></li>
  <li><b><a href="#SimConnect_MapClientDataNameToID">SimConnect_MapClientDataNameToID</a></b></li>
  <li><A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A></li>
  <li><A HREF="#SimConnect_SetClientData"><B>SimConnect_SetClientData</B></A></li>
  <LI><A HREF="#Visual C++ Reference"></A><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference </b></a></li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_FlightLoad"></A><H3>SimConnect_FlightLoad</H3>
<p>The <B>SimConnect_FlightLoad</B> function is used to load an existing flight file.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_FlightLoad(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szFileName</I><BR>
<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>szFileName</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the path to the flight  file. The path can either be absolute, or relative to the <i>My Documents\Flight Simulator X</i> folder. Flight files have the extension .FLT, but no need to enter an extension here.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>Flight files can be opened using a text editor. </p>
<H4>See Also</H4>
<UL type="disc">

  <li><A HREF="#SimConnect_FlightSave"><B>SimConnect_FlightSave</B></A></li>
  <li><A HREF="#SimConnect_FlightPlanLoad"><B>SimConnect_FlightPlanLoad</B></A></li>
  <LI><A HREF="#Visual C++ Reference"></A><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference </b></a></li>
</UL>

<BR><HR><BR>
<A NAME="SimConnect_FlightPlanLoad"></A><H3>SimConnect_FlightPlanLoad</H3>
<p>The <B>SimConnect_FlightPlanLoad</B> function is used to load an existing flight plan file.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_FlightPlanLoad(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szFileName</I><BR>
<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>szFileName</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the path to the flight plan file. Flight plans have the extension .PLN, but no need to enter an extension here. 
There is no need to enter the full path to the file (just enter the filename) if the flight file is in the default <i>Flight Simulator X Files</i> directory. The easiest way to create flight plans is to create them from within <i>Flight Simulator</i> itself, and then save them off for use by the user or AI controlled aircraft. </p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>Flight plan files can be opened using a text editor. </p>
<H4>See Also</H4>
<UL type="disc">

  <li><A HREF="#SimConnect_FlightLoad"><B>SimConnect_FlightLoad</B></A></li>
  <li><A HREF="#SimConnect_FlightSave"><B>SimConnect_FlightSave</B></A></li>
  <LI><A HREF="#Visual C++ Reference"></A><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference </b></a></li>
</UL>

<BR><HR><BR>
<A NAME="SimConnect_FlightSave"></A><H3>SimConnect_FlightSave</H3>
<p>The <B>SimConnect_FlightSave</B> function is used to save the current state of a flight to a flight file.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_FlightSave(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szFileName</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szDescription</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>Flags</I><BR>
<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>szFileName</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the path to the flight  file. The path can either be absolute, or relative to the <i>My Documents\Flight Simulator X</i> folder. Flight files have the extension .FLT, but no need to enter an extension here.</p>
<I>szDescription</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the text to enter in the Description field of the flight file.</p>
<p><I>Flags</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Unused.

<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>Flight files can be opened using a text editor. </p>
<H4>See Also</H4>
<UL type="disc">

  <li><A HREF="#SimConnect_FlightLoad"><B>SimConnect_FlightLoad</B></A></li>
  <li><A HREF="#SimConnect_FlightPlanLoad"><B>SimConnect_FlightPlanLoad</B></A></li>
  <LI><A HREF="#Visual C++ Reference"></A><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference </b></a></li>
</UL>

<hr>
<br>
<a name="SimConnect_GetLastSentPacketID"></a>
<h3>SimConnect_GetLastSentPacketID</h3>
<p>The <b>SimConnect_GetLastSentPacketID</b> function
  returns the ID of the last packet sent to the SimConnect server.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_GetLastSentPacketID(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD*</b>&nbsp;&nbsp;<i>pdwSendID</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>pdwSendID</i><br>
  &nbsp;&nbsp;[out]&nbsp;&nbsp;Pointer to a double word
  containing the ID of the last sent packet.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<p><code>DWORD dwLastID;<br>
      <br>
  hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_MY_EVENT, "Custom.Event");<br>
  hr = SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_MY_EVENT, 0, SIMCONNECT_GROUP_PRIORITY_HIGHEST, 0);<br>
  // Get the Send ID of the last transmission to the server<br>
  <b>hr = SimConnect_GetLastSentPacketID(hSimConnect, &amp;dwLastID);</b><br>
</code></p>
<h4>Working Sample</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#TrackingErrors">Tracking Errors </a></p></td>
  </tr>
</table>
<h4>Remarks</h4>
<p>This function should be used in conjunction with returned
  structures of type <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EXCEPTION">SIMCONNECT_RECV_EXCEPTION</a> 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.</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference </b></a></li>
</ul>
    
    <hr>
    <br>
    <a name="SimConnect_GetNextDispatch"></a>
    <h3>SimConnect_GetNextDispatch</h3>
    <p>The <b>SimConnect_GetNextDispatch</b> function is used
      to&nbsp;process the next SimConnect message received, without the
      use of a callback function.</p>
    <h4>Syntax</h4>
    <code><b>HRESULT SimConnect_GetNextDispatch(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_RECV**</b>&nbsp;&nbsp;<i>ppData</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD*</b>&nbsp;&nbsp;<i>pcbData</i><br>
<b>);</b><br>
<br>
    </code>
    <h4>Parameters</h4>
    <p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
      object. <br>
  <i>ppData</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to a pointer to a
      data buffer, initially to be treated as a <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a> structure.&nbsp;If you are going to make a copy of the data buffer
      (which is maintained
      by the SimConnect client library) make sure that the defined buffer is
      large enough (the size of the returned data structure is one member of
      the <a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a> structure.<br>
  <i>pcbData</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to the size of the
      data
      buffer, in bytes.&nbsp;</p>
    <h4>Return Values</h4>
    <p>The function returns an <b>HRESULT</b>. Possible
      values include, but are not limited to, those in the following table.</p>
    <br>
    <table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
      <tbody>
        <tr>
          <td><h5>Return value</h5></td>
          <td><h5>Description</h5></td>
        </tr>
        <tr>
          <td><p>S_OK</p></td>
          <td><p>The function succeeded. </p></td>
        </tr>
        <tr>
          <td><p>E_FAIL</p></td>
          <td><p>The function failed. </p></td>
        </tr>
      </tbody>
    </table>
    <h4>Example</h4>
    <code> SIMCONNECT_RECV* pData;<br>
DWORD cbData;<br>
<br>
<b>hr = SimConnect_GetNextDispatch(hSimConnect, &amp;pData, &amp;cbData);</b><br>
if (SUCCEEDED(hr))<br>
{<br>
&nbsp;&nbsp;switch(pData-&gt;dwID)<br>
&nbsp;&nbsp;{ <br>
&nbsp;&nbsp; &nbsp;case
SIMCONNECT_RECV_ID_OPEN: <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // enter code to
handle SimConnect version information received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_OPEN">SIMCONNECT_RECV_OPEN</a> structure.<br>
&nbsp;&nbsp; &nbsp;&nbsp; SIMCONNECT_RECV_OPEN *openData = (SIMCONNECT_RECV_OPEN*) pData;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
<br>
&nbsp;&nbsp; &nbsp;case
SIMCONNECT_RECV_ID_EVENT: <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // enter code to
handle events
received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a> structure.<br>
&nbsp;&nbsp; &nbsp;&nbsp; SIMCONNECT_RECV_EVENT *evt =
(SIMCONNECT_RECV_EVENT*) pData;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;case
SIMCONNECT_RECV_ID_EVENT_FILENAME:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // enter code to
handle event filenames
received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT_FILENAME">SIMCONNECT_RECV_EVENT_FILENAME</a><br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;// structure.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SIMCONNECT_RECV_EVENT_FILENAME *evt =
(SIMCONNECT_RECV_EVENT_FILENAME*) pData;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;case
SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // enter code to
handle AI objects that have been added or removed, and 
received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE">SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE</a><br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;// structure.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE *evt =
(SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE*) pData;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;case
SIMCONNECT_RECV_ID_EVENT_FRAME:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // enter code to
handle frame data received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT_FRAME">SIMCONNECT_RECV_EVENT_FRAME</a><br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;// structure.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SIMCONNECT_RECV_EVENT_FRAME *evt =
(SIMCONNECT_RECV_EVENT_FRAME*) pData;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;case
SIMCONNECT_RECV_ID_SIMOBJECT_DATA:<br>
&nbsp;&nbsp;&nbsp; &nbsp; // enter code to handle
object data
received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_SIMOBJECT_DATA">SIMCONNECT_RECV_SIMOBJECT_DATA</a> structure.<br>
&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;SIMCONNECT_RECV_SIMOBJECT_DATA
*pObjData = (SIMCONNECT_RECV_SIMOBJECT_DATA*) pData;<br>
&nbsp;&nbsp; &nbsp;&nbsp; break;<br>
<br>
&nbsp;&nbsp; &nbsp;case
SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE:<br>
&nbsp;&nbsp; &nbsp;&nbsp; // enter code to handle
object data
received in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE">SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</a><br>
&nbsp;&nbsp; &nbsp; &nbsp;// structure.<br>
&nbsp;&nbsp; &nbsp;&nbsp;
SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE
*pObjData = (SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE*) pData; <br>
&nbsp;&nbsp; &nbsp;&nbsp; break;<br>
<br>
&nbsp;&nbsp; &nbsp;case
SIMCONNECT_RECV_ID_QUIT:<br>
&nbsp;&nbsp; &nbsp;&nbsp; // enter code to handle
exiting the
application<br>
&nbsp;&nbsp; &nbsp;&nbsp; break;<br>
<br>
&nbsp;&nbsp; &nbsp;case
SIMCONNECT_RECV_ID_EXCEPTION:<br>
&nbsp;&nbsp; &nbsp;&nbsp; // enter code to handle
errors received
in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EXCEPTION">SIMCONNECT_RECV_EXCEPTION</a> structure. <br>
&nbsp;&nbsp; &nbsp;&nbsp; SIMCONNECT_RECV_EXCEPTION
*except =
(SIMCONNECT_RECV_EXCEPTION*) pData;<br>
&nbsp;&nbsp; &nbsp;&nbsp; break;<br>
<br>
&nbsp;&nbsp; &nbsp;case
SIMCONNECT_RECV_ID_WEATHER_OBSERVATION:<br>
&nbsp; &nbsp; &nbsp; // enter tode to handle object data
received in a </code><code><a style="font-weight: bold;" href="#SIMCONNECT_RECV_WEATHER_OBSERVATION">SIMCONNECT_RECV_WEATHER_OBSERVATION</a> structure.</code><br>
<code>&nbsp;&nbsp; &nbsp;&nbsp;
SIMCONNECT_RECV_WEATHER_OBSERVATION* pWxData =
(SIMCONNECT_RECV_WEATHER_OBSERVATION*) pData;<br>
&nbsp;&nbsp; &nbsp;&nbsp; const char* pszMETAR = (const
char*) (pWxData+1);<br>
&nbsp;&nbsp; &nbsp;&nbsp; break;<br>
<br>
&nbsp;&nbsp; &nbsp;// Enter similar case statements to handle the other types of data that can be received, including:<br>
&nbsp;&nbsp; &nbsp;// SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID,<br>
&nbsp;&nbsp; &nbsp;// SIMCONNECT_RECV_ID_RESERVED_KEY,<br>
&nbsp;&nbsp; &nbsp;// SIMCONNECT_RECV_ID_CUSTOM_ACTION<br>
&nbsp;&nbsp; &nbsp;// SIMCONNECT_RECV_ID_SYSTEM_STATE<br>
&nbsp;&nbsp; &nbsp;// SIMCONNECT_RECV_ID_CLOUD_STATE<br>
<br>
&nbsp;&nbsp; &nbsp;default:<br>
&nbsp;&nbsp; &nbsp;&nbsp; // enter code to handle the
case where
an unexpected message is received<br>
&nbsp;&nbsp; &nbsp;&nbsp; break;<br>
&nbsp;&nbsp; }<br>
}<br>
</code>
<h4>Working Sample</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample </h5></td>
    <td><a href="#NoCallback">No Callback </a>
        <p>&nbsp;</p></td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Remarks</h4>
<p>It is important to call this function sufficiently frequently
  that
  the queue of information received from the server is processed. <span style="font-family: &quot;Times New Roman&quot;;"> If there are no messages in the queue, the <span style="font-weight: bold;">dwID</span> parameter will
    be set to&nbsp;</span><b>SIMCONNECT_RECV_ID_NULL</b>.</p>
</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_CallDispatch"><b>SimConnect_CallDispatch</b></a></li>
</ul>
<BR><HR><BR>
<A NAME="SimConnect_MapClientDataNameToID"></A><H3>SimConnect_MapClientDataNameToID</H3>
<p>The <B>SimConnect_MapClientDataNameToID</B> function is used to asscociate an ID with a named client data area.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_MapClientDataNameToID(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szClientDataName</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_DATA_ID</B>&nbsp;&nbsp;<I>ClientDataID</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>szClientDataName</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the client data area name.
This is the name that another client will use to specify the data area. The name is not case-sensitive.<BR>
<CODE><I>ClientDataID</I></CODE><BR>
&nbsp;&nbsp;[in]&nbsp;A unique ID for the client data area, specified by the client.<BR>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>This function should be called once for each client data area: the client setting up the data should call it just before a call to <A HREF="#SimConnect_CreateClientData"><B>SimConnect_CreateClientData</B></A>, and the clients requesting the data should call it before any calls to <A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A> 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. </p>
<H4>See Also</H4>
<UL type="disc">

  <li><A HREF="#SimConnect_AddToClientDataDefinition"><B>SimConnect_AddToClientDataDefinition</B></A></li>
  <li><A HREF="#SimConnect_ClearClientDataDefinition"><B>SimConnect_ClearClientDataDefinition</B></A></li>
  <li><A HREF="#SimConnect_CreateClientData"><B>SimConnect_CreateClientData</B></A></li>
  <li><A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A></li>
  <li><A HREF="#SimConnect_SetClientData"><B>SimConnect_SetClientData</B></A></li>
  <LI><A HREF="#Visual C++ Reference"></A><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference </b></a></li>
</UL>

<hr><br>

<a name="SimConnect_MapClientEventToSimEvent"></a>
<h3>SimConnect_MapClientEventToSimEvent</h3>

<p>The <b>SimConnect_MapClientEventToSimEvent</b> function
associates a client defined event ID with a <i>Flight Simulator</i>
event name.</p>

<h4>Syntax</h4>

<code><b>HRESULT SimConnect_MapClientEventToSimEvent(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_CLIENT_EVENT_ID</b>&nbsp;&nbsp;<i>EventID</i><b>,</b><br>

&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>EventName</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.
<br>

<i>EventID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client event.
<br>

<i>EventName</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the <i>Flight
Simulator</i> event
name. Refer to the <a href="../Variables/Event IDs.htm">Event IDs</a> document for a list of event names (listed under SimConnect Name). If the
event name includes one or more periods (such as "Client.Event" in the
example below) then they are custom events specified by the client, and
will only be recognised by another client (and not <i>Flight
Simulator</i>) that has been coded
to receive such events. No <i>Flight Simulator</i> events
include periods. If no entry is made for this parameter, the event is private to the client. </p>

<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>

<p><code>
  static enum EVENT_ID {<br>
  &nbsp; EVENT_PAUSE,<br>
  &nbsp; EVENT_BRAKES,<br>
&nbsp; EVENT_CUSTOM,<br>
&nbsp; EVENT_PRIVATE,<br>
  };<br>
  
  <br>

  // Attach the client event EVENT_BRAKES to the simulation event "brakes"<br>
<b>  hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_BRAKES, "brakes");</b><br><br>
  
  // Attach the client event EVENT_PAUSE to the simulation event "pause_toggle"<br>
<b>  hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_PAUSE, "pause_toggle");</b><br><br>
  
  // Create a custom event, for use when communicating with other clients<br>
<b>  hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_CUSTOM, "Custom.Event");</b><br><br>
  
  // Create a private event for use within this client only<br>
  <b>hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_PRIVATE);</b><br>
   </code></p>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#ClientEvent">Client Event</a></p>
      <p><a href="#CockpitCamera">Cockpit Camera</a></p>
      <p><a href="#JoystickInput">Joystick Input</a></p>
      <p><a href="#ReservedKey">Reserved Key</a></p>
      <p><a href="#SendEventA">Send Event A </a></p>
      <p><a href="#SendEventB">Send Event B</a></p>
      <p><a href="#SendEventC">Send Event C</a></p>
      <p><a href="#SetData">Set Data</a></p>
      <p><a href="#ThrottleControl">Throttle Control</a></p>
      <p><a href="#TrackingErrors">Tracking Errors </a></p>    </td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td>All but a few of the other <a href="#WorkingSamples">samples</a> implement this function. </td>
  </tr>
</table>
<p></p>
<h4>Remarks</h4><p>Client events, such as EVENT_BRAKES, must be added to a group
event (to set the appropriate priority) before event notifications will
be received from the SimConnect server (see the <a href="#SimConnect_AddClientEventToNotificationGroup"><span style="font-weight: bold;">SimConnect_AddClientEventToNotificationGroup</span></a>
function).</p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a> </li>

  <li><a href="#SimConnect_TransmitClientEvent"><b>SimConnect_TransmitClientEvent</b></a></li>
</ul>

<hr>
<br>
<a name="SimConnect_MapInputEventToClientEvent"></a>
<h3>SimConnect_MapInputEventToClientEvent</h3>
<p>The <b>SimConnect_MapInputEventToClientEvent</b> function is
  used to connect input events (such as keystrokes, joystick or mouse
  movements) with the sending of appropriate event notifications.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_MapInputEventToClientEvent(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_INPUT_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><b>,</b><br>
&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>pszInputDefinition</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_CLIENT_EVENT_ID</b>&nbsp;&nbsp;<i>DownEventID</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>DownValue</i><b> <span style="font-style: italic;">= 0,</span></b><br>
&nbsp;&nbsp;<b>SIMCONNECT_CLIENT_EVENT_ID</b>&nbsp;&nbsp;<i>UpEventID</i><span style="font-weight: bold;"> =<span style="font-style: italic;">(SIMCONNECT_CLIENT_EVENT_ID)SIMCONNECT_UNUSED,</span></span><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>UpValue = 0</i><br>
&nbsp;&nbsp;<b>BOOL</b>&nbsp;&nbsp;<i>bMaskable = FALSE</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>GroupID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  input group that the input event is to be added to. <br>
  <i>pszInputDefinition</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to a
  null-terminated string containing the definition of the input events
  (keyboard keys, mouse or joystick events, for example). See the Remarks
  and example
  below for a range of possibilities.&nbsp; <br>
  <i>DownEventID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  down, and default, event.
  This is the client defined event that is triggered when the input
  event occurs. If only an up event is required, set this to <b>SIMCONNECT_UNUSED</b>.<br>
  <i>DownValue</i><br>
  &nbsp;&nbsp;[in, optional]&nbsp;Specifies an optional numeric value, which will be returned when the down event occurs. <br>
  <i>UpEventID</i><br>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies the ID
  of the up
  event. This is the client defined event that is triggered when the up
  action
  occurs. <br>
  <i>UpValue</i><br>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies an optional numeric value, which will be returned when the up event occurs.</p>
<p><i>bMaskable</i><br>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;If set to true, specifies that the client will mask the event, and no other lower priority clients will receive it. The default is false.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<p><code> <br>
  static enum INPUT_ID {<br>
  &nbsp;&nbsp; &nbsp;&nbsp; INPUT_1,<br>
  };<br>
  <br>
  static enum EVENT_ID {<br>
  &nbsp;&nbsp;&nbsp;&nbsp; EVENT_1,<br>
  &nbsp;&nbsp;&nbsp; &nbsp;EVENT_2,<br>
  &nbsp;&nbsp;&nbsp; &nbsp;EVENT_3 &nbsp; <br>
  };<br>
  <br>
  hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_1, "parking_brakes");</code></p>
<p><code>// Set similar mappings for EVENT_2 and EVENT_3 <br>
      <br>
  // </code><code>Lower case a and
    upper case B are
    hit together</code><br>
      <code><span style="font-weight: bold;">hr =
        SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1, "a+B",
        EVENT_1);</span><br>
        <br>
        // Ctrl, upper case A and upper case U are hit together<br>
  <span style="font-weight: bold;">hr =
    SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1, "Ctrl+A+U",
    EVENT_1);</span><br>
      <br>
        // Ctrl, shift, lower case a, has been hit <br>
  <span style="font-weight: bold;">hr =
    SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1, "shift+ctrl+a",
    EVENT_2);</span><br>
    </code></p>
<p><code>// Ctrl, shift, lower case a, will trigger an EVENT_2 when it is pressed, and an EVENT_3 when released <br>
      <span style="font-weight: bold;">hr =
        SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1, "shift+ctrl+a",
        EVENT_2, 0, EVENT_3);</span><br>
</code></p>
<p><code>// The first configured button of joystick 0 is hit<br>
      <span style="font-weight: bold;">hr =
        SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1,
        "joystick:0:button:0", EVENT_2);</span><br>
    <br>
  // The second configured button of joystick 0 is hit<br>
  <span style="font-weight: bold;">hr =
    SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1,
    "joystick:0:button:1", EVENT_3);</span><br>
    <br>
  // The first configured joystick has had its first configured point of view (or hat) switch pressed <br>
  <span style="font-weight: bold;">hr =
    SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1,
    "joystick:0:POV:0", EVENT_3);</span><br>
    <br>
  // The first configured joystick has been moved along the x axis <br>
  <span style="font-weight: bold;">hr =
    SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1,
    "joystick:0:XAxis", EVENT_3);</span><br>
    <br>
    <br>
  hr = SimConnect_SetInputGroupPriority(hSimConnect, INPUT_1,
  SIMCONNECT_GROUP_PRIORITY_HIGHEST);<br>
</code></p>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#CockpitCamera">Cockpit Camera</a></p>
        <p><a href="#InputEvent">Input Event </a></p>
      <p><a href="#JoystickInput">Joystick Input</a></p>
      <p><a href="#ThrottleControl">Throttle Control</a></p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td><a href="#SetData">Set Data</a></td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Remarks</h4>
<p>The maximum number of events that can be added
  to an input group is 1000.</p>
<p>&nbsp;</p>
<p>For the keyboard the input definition can include a maximum
  of two modifiers (<span style="font-weight: bold;">Shift</span>, <span style="font-weight: bold;">Ctrl</span>, <span style="font-weight: bold;">Alt</span>) and two keys
  (case senstive).</p>
<p></p>
<p>For joysticks the input definition is in the form
  "joystick:n:input[:i]". Where <span style="font-style: italic;">n</span> is the joystick number (starting from 0), <span style="font-style: italic;">input</span> is the input
  name, and <span style="font-style: italic;">i</span> 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:</p>
<p>&nbsp;</p>
<table width="200" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td width="95"><h5>Input Name </h5></td>
    <td width="396"><h5>Description</h5></td>
    <td width="131"><h5>Range of values </h5></td>
  </tr>
  <tr>
    <td><b>Button</b></td>
    <td>One of the joystick buttons, configured from 0.</td>
    <td>Not applicable </td>
  </tr>
  <tr>
    <td><b>POV</b></td>
    <td>Point of view switch (often called the hat switch). </td>
    <td><p>0 facing ahead</p>
        <p>4500 forward right</p>
      <p>9000 right</p>
      <p>13500 rear right</p>
      <p>18000 rear</p>
      <p>22500 rear left</p>
      <p>27000 left</p>
      <p>31500 forward left</p></td>
  </tr>
  <tr>
    <td><b>Slider</b></td>
    <td>The variable position slider on the joystick. </td>
    <td>The actual values returned can vary widely on the joystick, though the limits are 32K (pulled back to the limit) to -32K (maximum forward limit). </td>
  </tr>
  <tr>
    <td><b>XAxis</b>, <b>YAxis</b> or <b>ZAxis</b> </td>
    <td>Movement of the joystick in the X, Y, or Z directions. For most joysticks the movement is left or right for the XAxis and forward or backward for the YAxis, with no values for the ZAxis. </td>
    <td>The limits in the Y axis are 32K (pulled back) to -32K (pushed forward). The limits in the X axis are -32K (full left) to 32K (full right). Depending on the joystick though, the limits may be significantly less than these values. </td>
  </tr>
  <tr>
    <td><b>RxAxis</b>, <b>RyAxis</b>, or <b>RzAxis</b> </td>
    <td>Rotation of the joystick about the X, Y, or Z axis. For most joysticks there is only rotational movement around the Z axis, with no values for the X or Y axis. </td>
    <td>For the Z axis, the limits are -32K (rotated left to the maximum) to 32K (rotated right to the maximum). Again, actual limits depend on the joystick. </td>
  </tr>
</table>
<p>&nbsp;</p>
<p>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 <i>dwData</i> parameter of a <a href="#SIMCONNECT_RECV_EVENT"><b>SIMCONNECT_RECV_EVENT</b></a> structure.</p>
<p>&nbsp;</p>
<p>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. </p>
<p>&nbsp;</p>
<p>For reference, the default input mappings of joystick
  buttons to
  events is specified in the devices.cfg file in the main FSX directory.</p>
<p></p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_SetInputGroupPriority"><b>SimConnect_SetInputGroupPriority</b></a></li>
  <li><a href="#SimConnect_RemoveInputEvent"><b>SimConnect_RemoveInputEvent</b></a></li>
  <li><a href="#SimConnect_ClearInputGroup"><b>SimConnect_ClearInputGroup</b></a></li>
  <li><a href="#SimConnect_SetInputGroupState"><b>SimConnect_SetInputGroupState</b></a></li>
</ul>
<hr>
<br>
<a name="SimConnect_Open"></a>
<h3>SimConnect_Open</h3>
<p>The <b>SimConnect_Open</b> function is used to
  send a request to the <i>Flight Simulator</i> server to
  open up communications with a new
  client.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_Open(</b><br>
&nbsp;&nbsp;<b>HANDLE*</b>&nbsp;&nbsp;<i>phSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>LPCSTR</b>&nbsp;&nbsp;<i>szName</i><b>,</b><br>
&nbsp;&nbsp;<b>HWND</b>&nbsp;&nbsp;<i>hWnd</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>UserEventWin32</i><b>,</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hEventHandle</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>ConfigIndex</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>phSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to a handle to a
  SimConnect object. <br>
  <i>szName</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to a
  null-terminated string containing an appropriate name for the client
  program.<br>
  <i>hWnd</i><br>
  &nbsp;&nbsp;[in]&nbsp; Handle to a Windows object.
  Set this to NULL if the handle is not being used. <br>
  <i>UserEventWin32</i><br>
  &nbsp;&nbsp;[in]&nbsp; Code number that the client
  can specify. Set this to 0 if it is not being used.<br>
  <i>hEventHandle</i><br>
  &nbsp;&nbsp;[in] A Windows Event handle. A client can be written to respond to Windows Events, rather than use a polling and callback system, which can be a more efficient process if the client does not have to respond very frequently to changes in data in <i>Flight Simulator</i>.<br>
  <i>ConfigIndex</i><br>
  &nbsp;&nbsp;[in]&nbsp; The configuration index. The SimConnect.cfg file can contain a number of configurations, identifed in sections with the [SimConnect.<i>N</i>] title. Setting this configuration index indicates which configuration settings to use for this SimConnect client. This is useful for applications that communicate with a number of different machines that are running <i>Flight Simulator</i>. The default configuration index is zero. Note the E_INVALIDARG return value. </p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
    <tr>
      <td>E_INVALIDARG</td>
      <td>A SimConnect section in the Simconnect.cfg file did not contain the config index requested in the parmaters.</td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code> HRESULT hr;<br>
HANDLE hSimConnect = NULL;<br>
<br>
<span style="font-weight: bold;">hr =
SimConnect_Open(&amp;hSimConnect, "Your Application Name",
NULL, 0, 0, 0);<br>
<br>
</span></code>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#OpenandClose">Open and Close</a></p>
        <p><a href="#WindowsEvent">Windows Event </a></p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td>All  of the other <a href="#WorkingSamples">samples</a> implement this function. </td>
  </tr>
</table>
<h4>Remarks</h4>
<p>Most client applications will have one <span style="font-weight: bold;">SimConnect_Open</span> call, and one corresponding <a style="font-weight: bold;" href="#SimConnect_Close">SimConnect_Close</a> call.
  However in some&nbsp;applications, multiplayer in
  particular,&nbsp; multiple <span style="font-weight: bold;">SimConnect_Open</span> calls may be necessary, in which case an array or list of handles will
  need to be maintained, and closed appropriately.</p>
<p>&nbsp;</p>
<p>A client can optionally examine the <b><a href="#SIMCONNECT_RECV_OPEN">SIMCOMMENT_RECV_OPEN</a></b> structure that is returned after a call to <b>SimConnect_Open</b>. This structure gives versioning and build information that should be useful when multiple versions of SimConnect and multiple versions of <i>Flight Simulator</i> that support it, are available. </p>
<p>&nbsp;</p>
<p>If a remote client successfully establishes a link with <i>Flight Simulator</i>, but at some later time the network connection is lost, SimConnect functions will return the NTSTATUS error  STATUS_REMOTE_DISCONNECT         (0xC000013CL).</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_Close"><b>SimConnect_Close</b></a><br>
  </li>
</ul>
<hr>
<br>
<a name="SimConnect_RemoveClientEvent"></a>
<h3>SimConnect_RemoveClientEvent</h3>
<p>The <b>SimConnect_RemoveClientEvent</b> function
  is used to remove a client defined event from a notification group.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_RemoveClientEvent(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_NOTIFICATION_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_CLIENT_EVENT_ID</b>&nbsp;&nbsp;<i>EventID</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>GroupID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  group. <br>
  <i>EventID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  event ID that is to be removed from the group.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code>static enum EVENT_ID {<br>
&nbsp; EVENT_1,<br>
&nbsp; EVENT_2<br>
&nbsp; EVENT_3<br>
}; <br>
static enum GROUP_ID {<br>
&nbsp; GROUP_1,<br>
};<br>
hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_1, EVENT_1);<br>
hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_1, EVENT_2);<br>
hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_1, EVENT_3, TRUE);<br>
<br>
<span style="font-weight: bold;">hr =
SimConnect_RemoveClientEvent(hSimConnect, GROUP_1, EVENT_2);</span><br>
<br>
</code>
<h4>Remarks</h4>
<p>Use this function to permanently remove the client event. There is no reliable procedure to temporarily turn off a client event. </p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_AddClientEventToNotificationGroup"><b>SimConnect_AddClientEventToNotificationGroup</b></a></li>
  <li><a href="#SimConnect_SetNotificationGroupPriority"><b>SimConnect_SetNotificationGroupPriority</b></a></li>
  <li><a href="#SimConnect_ClearNotificationGroup"><b>SimConnect_ClearNotificationGroup</b></a></li>
</ul>
<hr>
<br>
<a name="SimConnect_RemoveInputEvent"></a>
<h3>SimConnect_RemoveInputEvent</h3>
<p>The <b>SimConnect_RemoveInputEvent</b> function is
  used to remove an input event from a specified input group object.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_RemoveInputEvent(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_INPUT_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><b>,</b><br>
&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>pszInputDefinition</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>GroupID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  input group from which the event is to be removed. <br>
  <i>pszInputDefinition</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to a
  null-terminated string containing the input definition.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code> static enum INPUT_ID {<br>
&nbsp; INPUT_1,<br>
};<br>
static enum EVENT_ID {<br>
&nbsp; EVENT_1,<br>
};<br>
hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_1, "parking_brakes");<br>
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1, "a+B", EVENT_1);<br>
....<br>
<span style="font-weight: bold;">hr =
SimConnect_RemoveInputEvent(hSimConnect, INPUT_1, "a+B");</span><br>
<br>
</code>
<h4>Remarks</h4>
<p>The input string definitions must match exactly, before
  anything
  is removed from the group definition. For example, the string
  defintiions <span style="font-weight: bold;">"A+B"</span> and <span style="font-weight: bold;">"a+B"</span> do not match.</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_MapInputEventToClientEvent"><b>SimConnect_MapInputEventToClientEvent</b></a></li>
  <li><a href="#SimConnect_SetInputGroupPriority"><b>SimConnect_SetInputGroupPriority</b></a></li>
  <li><a href="#SimConnect_ClearInputGroup"><b>SimConnect_ClearInputGroup</b></a></li>
  <li><a href="#SimConnect_SetInputGroupState"><b>SimConnect_SetInputGroupState</b></a></li>
</ul>

<BR><HR><BR>
<A NAME="SimConnect_RequestClientData"></A><H3>SimConnect_RequestClientData</H3>
<p>The <B>SimConnect_RequestClientData</B> function is used to request that the specified data in an area created by another client be sent to this client.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_RequestClientData(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_DATA_ID</B>&nbsp;&nbsp;<I>ClientDataID</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_DATA_DEFINITION_ID</B>&nbsp;&nbsp;<I>DefineID</I><B>,</B><br>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwReserved1 = SIMCONNECT_UNUSED</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwReserved2 = SIMCONNECT_UNUSED</I><br>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>

<I>ClientDataID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client data area. Before calling this function for the first time on one client area, call <b><a href="#SimConnect_MapClientDataNameToID">SimConnect_MapClientDataNameToID</a></b> to map an ID to the unique client data area name. This name must match the name specified by the client creating the data area with the <b><a href="#SimConnect_MapClientDataNameToID">SimConnect_MapClientDataNameToID</a></b> and <a href="#SimConnect_CreateClientData"><b>SimConnect_CreateClientData</b></a> functions. <BR>

<I>RequestID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client-defined
request. This is used later by the client to identify which data has
been
received. 
This value should be unique for each request, re-using a <i>RequestID</i> will overwrite any previous request using the same ID. <BR>


<I>DefineID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the client-defined data definition. This definition specifies the 
data that should be sent to the client.<br>

<I>dwReserved1</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Reserved for future use.<br>
<I>dwReserved2</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Reserved for future use.

</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>A data definition must be specified, using the <A HREF="#SimConnect_AddToClientDataDefinition"><B>SimConnect_AddToClientDataDefinition</B></A> 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.</p>
<p>&nbsp;</p>
<p>The data will be returned in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_CLIENT_DATA">SIMCONNECT_RECV_CLIENT_DATA</a> structure.</p>
<H4>See Also</H4>
<UL type="disc">

  
  <li><A HREF="#SimConnect_AddToClientDataDefinition"><B>SimConnect_AddToClientDataDefinition</B></A></li>
  <li><A HREF="#SimConnect_ClearClientDataDefinition"><B>SimConnect_ClearClientDataDefinition</B></A></li>
  <li><A HREF="#SimConnect_CreateClientData"><B>SimConnect_CreateClientData</B></A></li>
  <li><b><a href="#SimConnect_MapClientDataNameToID">SimConnect_MapClientDataNameToID</a></b></li>
  <li><A HREF="#SimConnect_SetClientData"><B>SimConnect_SetClientData</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<br>
<HR>
<br>

<a name="SimConnect_RequestDataOnSimObject"></a>
<h3>SimConnect_RequestDataOnSimObject</h3>

<p>The <b>SimConnect_RequestDataOnSimObject</b> function
is used to request when the SimConnect client is to receive data values
for a specific&nbsp;object.</p>

<h4>Syntax</h4>

<code><b>HRESULT SimConnect_RequestDataOnSimObject(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATA_REQUEST_ID</b>&nbsp;&nbsp;<i>RequestID</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATA_DEFINITION_ID</b>&nbsp;&nbsp;<i>DefineID</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_OBJECT_ID</b>&nbsp;&nbsp;<i>ObjectID</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_PERIOD</b>&nbsp;&nbsp;<i>Period</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATA_REQUEST_FLAG</b>&nbsp;&nbsp;<i>Flags = 0</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>origin = 0</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>interval = 0</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>limit = 0</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.
<br>

<i>RequestID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client defined
request. This is used later by the client to identify which data has
been
received.
This value should be unique for each request, re-using a <i>RequestID</i> will overwrite any previous request using the same ID. <br>

<i>DefineID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client defined
data definition.
<br>

<i>ObjectID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the <i>Flight
Simulator</i> object
that the data should be about. This ID can be <b>SIMCONNECT_OBJECT_ID_USER</b> (to specify the user's aircraft) or obtained from a&nbsp;<a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE"><b>SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</b></a>&nbsp;structure
after a call to <b><a href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>.</b><br>

<i>Period</i><br>

&nbsp;&nbsp;[in]&nbsp; One member of the <a style="font-weight: bold;" href="#SIMCONNECT_PERIOD">SIMCONNECT_PERIOD</a>
enumeration type, specifying how often the data is to be sent by the
server and recieved by the client.</p>

<p><i>Flags</i><br>

&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;A DWORD containing one or more of the following values:
<br>
<table class = "T1">
<tr><td><h5>Flag value</h5></td><td><h5>Description</h5></td></tr>
<tr><td><b>0</b></td>
<td>The default, data will be sent strictly according to the defined period.</td></tr>
<tr>
  <td><b>SIMCONNECT_DATA_REQUEST_FLAG_CHANGED</b></td>
  <td>Data will only be sent to the client when one or more values have changed. If this is the only flag set, then all the variables in a data definition will be returned if just one of the values changes. </td>
</tr>
<tr>
  <td><b>SIMCONNECT_DATA_REQUEST_FLAG_TAGGED</b></td>
  <td>Requested data will be sent in tagged format (datum ID/value pairs). Tagged format requires that a datum reference ID is returned along with the data value, in order that the client code is able to identify the variable. This flag is usually set in conjunction with the previous flag, but it can be used on its own to return all the values in a data definition in datum ID/value pairs. See the <a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a> structure for more details. </td>
</tr>
</table>
</p>

<p><i>origin</i><br>

&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;The number of <i>Period</i> events that should elapse before transmission of the data begins.
The default is zero, which means transmissions will start immediately. </p>

<p><i>interval</i><br>

&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;The number of <i>Period</i> events that should elapse between transmissions of the data.
The default is zero, which means the data is transmitted every <i>Period</i>.</p>

<p><i>limit</i><br>

&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;The number of times the data should be transmitted before this communication is ended.
The default is zero, which means the data should be transmitted endlessly.</p>

<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>

<p><code>static enum DATA_DEFINE_ID {<br>
  &nbsp; DEFINITION_1,<br>
  &nbsp; DEFINITION_2<br>
  
  };<br>
  
  <br>
  
  static enum DATA_REQUEST_ID {<br>
  &nbsp;&nbsp;&nbsp; REQUEST_1,<br>
  &nbsp;&nbsp;&nbsp; REQUEST_2,<br>
  
  };<br>
  
  <br>
  
  struct Struct1<br>
  
  {<br>
  &nbsp;&nbsp;&nbsp; double&nbsp; kohlsmann;<br>
  &nbsp;&nbsp;&nbsp; double&nbsp; altitude;<br>
  &nbsp;&nbsp;&nbsp; double&nbsp; latitude;<br>
  &nbsp;&nbsp;&nbsp; double&nbsp; longitude;<br>
  
  };</code></p>
<p>&nbsp;</p>
<p><code>
  // Match string definitions from the Simulation Variables document with
  the client defined ID<br>
  
  <br>
  hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1,
  "Kohlsman setting hg", "inHg");<br>
  hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1,
  "Indicated Altitude", "feet");<br>
  hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "Plane
  Latitude", "degrees");<br>
  hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "Plane
  Longitude", "degrees");<br>
  
  <br>
  // Sections&nbsp;of code in DispatchProc<br>
  
  <br>
  ....<br>
  
  <span style="font-weight: bold;">SimConnect_RequestDataOnSimObject(hSimConnect,
    REQUEST_2, DEFINITION_1, SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_SECOND);</span><br>
  ....<br>
  // When the data is received - cast it to the correct structure type <br>
  
  <br>
  case SIMCONNECT_RECV_ID_SIMOBJECT_DATA:<br>
  {<br>
  &nbsp;&nbsp;SIMCONNECT_RECV_SIMOBJECT_DATA *pObjData =
  (SIMCONNECT_RECV_SIMOBJECT_DATA*) pData;<br>
  
  <br>
  &nbsp;&nbsp;switch(pObjData-&gt;dwRequestID)<br>
  &nbsp;&nbsp;{<br>
  &nbsp;&nbsp; &nbsp;case REQUEST_2:<br>
  
  <br>
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;Struct1 *pS =
  (Struct1*)&amp;pObjData-&gt;dwData;<br>
  &nbsp;&nbsp;&nbsp; <br>
  &nbsp;&nbsp;&nbsp; &nbsp; // Add code to process the
  structure appropriately<br>
  
  <br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
  &nbsp; }<br>
  break;<br>
  }<br>
  ....<br>
</code></p>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#TaggedData">Tagged Data</a></p>    </td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td><a href="#WeatherStation">Weather Station </a></td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Remarks</h4>
<p>Changing the <i>Period</i> parameter or changing the content of a data definition has a higher performance cost than changing the <i>origin</i>, <i>interval</i> or <i>limit</i> parameters. So to termporarily turn off data requests, especially for short periods of time, consider setting the <i>interval</i> parameter to a very high value (such as <b>DWORD _MAX</b>). If changes are required to a data definition, consider setting the <i>Period</i> parameter to <b>SIMCONNECT_PERIOD_NEVER</b> (see the <a style="font-weight: bold;" href="#SIMCONNECT_PERIOD">SIMCONNECT_PERIOD</a> enumeration) before making the changes, and then turning on the appropriate period after the changes have been made. </p>
<p>&nbsp;</p>
<p>Data is always transmitted with the <b>SimConnect_RequestDataOnSimObject</b> function, so if timing only notifications are required, use  the <a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a> function.</p>
<p>&nbsp;</p>
<p>Note that variable length strings should not be used in data defintions, except where the <i>Period</i> parameter has been set to <b>SIMCONNECT_PERIOD_ONCE</b>.</p>
<p>&nbsp;</p>
<p>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 uniques title strings, including those simply with different color schemes). An example of requesting the aircraft title is in the <a href="#VariableStrings">Variable Strings </a> working sample. See the <a href="../../SimObject Creation Kit/SimObject Container SDK/Aircraft Configuration Files.htm">Aircraft Configuration Files</a> document for more details on titles.</p>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a> </li>

  <li><a href="#SimConnect_AddToDataDefinition"><b>SimConnect_AddToDataDefinition</b></a></li>

  <li><a href="#SimConnect_ClearDataDefinition"><b>SimConnect_ClearDataDefinition</b></a></li>

  <li><a href="#SimConnect_RequestDataOnSimObjectType"><b>SimConnect_RequestDataOnSimObjectType</b></a></li>
</ul>

<br>

<hr><br>

<a name="SimConnect_RequestDataOnSimObjectType"></a>
<h3>SimConnect_RequestDataOnSimObjectType</h3>

<p>The <b>SimConnect_RequestDataOnSimObjectType</b>
function is used to retrieve informtion&nbsp;about simulation
objects of a given type that are within a specifed radius of the
user's aircraft.</p>

<h4>Syntax</h4>

<code><b>HRESULT SimConnect_RequestDataOnSimObjectType(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATA_REQUEST_ID</b>&nbsp;&nbsp;<i>RequestID</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATA_DEFINITION_ID</b>&nbsp;&nbsp;<i>DefineID</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>dwRadiusMeters</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_SIMOBJECT_TYPE</b>&nbsp;&nbsp;<i>type</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.
<br>

<i>RequestID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client defined
request.
This is used later by the client to identify which data has been
received.

This value should be unique for each request, re-using a <i>RequestID</i> will overwrite any previous request using the same ID. <br>

<i>DefineID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client defined
data definition.
<br>

<i>dwRadiusMeters</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing the
radius in meters. If this is set to zero then information on all
relevant objects will be returned. This value is ignored if <span style="font-style: italic;">type</span> is set
to <a style="font-weight: bold;" href="#SIMCONNECT_SIMOBJECT_TYPE">SIMCONNECT_SIMOBJECT_TYPE_USER</a>. The error SIMCONNECT_EXCEPTION_OUT_OF_BOUNDS will be returned if a radius is given and it exceeds the maximum allowed (200 Km).<br>

<i>type</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the type of
object to receive information on. One member of the&nbsp;<a href="#SIMCONNECT_SIMOBJECT_TYPE"><b>SIMCONNECT_SIMOBJECT_TYPE</b></a>
enumeration type.</p>

<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>

<p>See <a href="#SimConnect_AddToDataDefinition"><span style="font-weight: bold;">SimConnect_AddToDataDefinition</span></a>
for an example of when to use this function</p>

<br>

<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#RequestData">Request Data </a></p>
      <p><a href="#VariableStrings">Variable Strings </a></p>    </td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td><p>&nbsp;</p>    </td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Remarks</h4>
<p>The data will be returned on all the relevant objects within
the specified radius, but they will not be returned in any specific
order. It is the responsibility of the client program to sort the
returned data into order, if that is required. Information is returned in a <a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE"><b>SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</b></a>&nbsp;structure,
one structure per object.</p>

<p>&nbsp;</p>
<h4>See Also</h4>
<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a> </li>

  <li><a href="#SimConnect_AddToDataDefinition"><b>SimConnect_AddToDataDefinition</b></a></li>

  <li><a href="#SimConnect_ClearDataDefinition"><b>SimConnect_ClearDataDefinition</b></a></li>

  <li><a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a></li>
</ul>
<hr>
<br>
<a name="SimConnect_RequestNotificationGroup"></a>
<h3>SimConnect_RequestNotificationGroup</h3>
<p>The <b>SimConnect_RequestNotificationGroup</b> function
  is used to request events are transmitted from a notification group, when the simulation is in Dialog Mode. </p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_RequestNotificationGroup(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_NOTIFICATION_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>dwReserved = 0</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>Flags = 0</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>GroupID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  group. <br>
  <i>dwReserved</i>
  <br>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Reserved for future use.</p>
<p><i>Flags</i><br>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Reserved for future use.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Remarks</h4>
<p>In this version this function has the specific purpose of enabling the sending of events, particularly  joystick events, when the simulation is  in Dialog Mode.</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_AddClientEventToNotificationGroup"><b>SimConnect_AddClientEventToNotificationGroup</b></a></li>
  <li><a href="#SimConnect_SetNotificationGroupPriority"><b>SimConnect_SetNotificationGroupPriority</b></a></li>
  <li><a href="#SimConnect_ClearNotificationGroup"><b>SimConnect_ClearNotificationGroup</b></a></li>
</ul>

<HR>
<BR>
<A NAME="SimConnect_RequestReservedKey"></A>
<H3>SimConnect_RequestReservedKey</H3>
<p>The <B>SimConnect_RequestReservedKey</B> function is used to request a specific keyboard TAB-key combination applies only to this client.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_RequestReservedKey(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_EVENT_ID</B>&nbsp;&nbsp;<I>EventID</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szKeyChoice1</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szKeyChoice2 = &quot;&quot;</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szKeyChoice3 = &quot;&quot;</I><BR>
<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object. <BR>
  <I>EventID</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined event ID. <BR>
  <I>szKeyChoice1</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the first key choice. Refer to the document <a href="Images/Key Strings.html">Key Strings</a> for a full list of choices that can be entered for these three parameters. </p>
<p><I>szKeyChoice2</I><BR>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Null-terminated string containing the second key choice. <BR>
  <I>szKeyChoice3</I><BR>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Null-terminated string containing the third key choice.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR>
<table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5>
  <tr>
    <td><H5>Return value</H5></td>
    <td><H5>Description</H5></td>
  </tr>
  <tr>
    <td><p>S_OK</p></td>
    <td><p>The function succeeded. </p></td>
  </tr>
  <tr>
    <td><p>E_FAIL</p></td>
    <td><p>The function failed. </p></td>
  </tr>
</table>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#ReservedKey">Reserved Key</a></p></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>A successful call to this function will result in a <b><a href="#SIMCONNECT_RECV_RESERVED_KEY">SIMCONNECT_RECV_RESERVED_KEY</a></b> 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.</p>
<p>&nbsp;</p>
<p>The <i>szKeyChoice</i> 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.</p>
<H4>See Also</H4>
<UL type="disc">
  <li><A HREF="#SimConnect_MenuAddItem"><B>SimConnect_MenuAddItem</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a></li>
</UL>
<HR>
<BR>
<H3><a name="SimConnect_RequestSystemState">SimConnect_RequestSystemState</a></H3>
The <B>SimConnect_RequestSystemState</B> function is used to request information from a number of <i>Flight Simulator</i> system components. <BR>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_RequestSystemState(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><BR>
&nbsp;&nbsp;<b>SIMCONNECT_DATA_REQUEST_ID</b>&nbsp;&nbsp;<i>RequestID</i><b>,</b><br>
&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>szState</i><b>,</b><br>
<B>);</B></CODE><BR>
<CODE><BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
  &nbsp;&nbsp;Handle to a SimConnect object.<BR>
  <I>RequestID</I><BR>
  &nbsp;&nbsp;The client defined request ID.<BR>
  <I>szState</I><BR>
  &nbsp;&nbsp;A null-terminated string identifying the system function. One from the following table: </p>
<p>&nbsp;</p>
<table width="500" class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>String</h5></td>
    <td><h5>Description</h5></td>
  </tr>
  <tr>
    <td><b>AircraftLoaded</b></td>
    <td>Requests the full path name of the last loaded aircraft flight dynamics file. These files have a .AIR extension. </td>
  </tr>
  <tr>
    <td><b>DialogMode</b></td>
    <td>Requests whether the simulation is in Dialog mode or not. See <A HREF="#SimConnect_SetSystemState"><B>SimConnect_SetSystemState</B></A> for a description of Dialog mode. </td>
  </tr>
  <tr>
    <td><b>FlightLoaded</b></td>
    <td>Requests the full path name of the last loaded flight. Flight files have the extension .FLT. </td>
  </tr>
  <tr>
    <td><b>FlightPlan</b></td>
    <td>Requests the full path name of the active flight plan. An empty string will be returned if there is no active flight plan. </td>
  </tr>
  <tr>
    <td><b>Sim</b></td>
    <td>Requests the state of the simulation. If 1 is returned, the user is in control of the aircraft, if 0 is returned, the user is navigating the UI. This is the same state that notifications can be subscribed to with the &quot;<b>SimStart</b>&quot; and &quot;<b>SimStop</b>&quot; string with the <b><a href="#SimConnect_SubscribeToSystemEvent">SimConnect_SubscribeToSystemEvent</a></b> function. </td>
  </tr>
</table>
<p>&nbsp;</p>
<H4>Return Values</H4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<H4>Remarks</H4>
The information requested will be returned in a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_SYSTEM_STATE">SIMCONNECT_RECV_SYSTEM_STATE</a> structure.<BR>
<H4>See Also</H4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a></li>
  <li><A HREF="#SimConnect_SetSystemState"><B>SimConnect_SetSystemState</B></A></li>
</ul>
<BR><HR><BR>
<A NAME="SimConnect_SetClientData"></A><H3>SimConnect_SetClientData</H3>
<p>The <B>SimConnect_SetClientData</B> function is used to write one or more units of data to a client data area.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_SetClientData(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_DATA_ID</B>&nbsp;&nbsp;<I>ClientDataID</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_DATA_DEFINITION_ID</B>&nbsp;&nbsp;<I>DefineID</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwReserved</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>ArrayCount</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>cbUnitSize</I><B>,</B><BR>
&nbsp;&nbsp;<B>void*</B>&nbsp;&nbsp;<I>pDataSet</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.

<BR><I>ClientDataID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client data area.<BR>

<I>DefineID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  client data definition.<BR>
  
<I>dwReserved</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Reserved for future use. Set to zero.<BR>

<I>ArrayCount</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Reserved for future use. Set to zero.<BR><I>cbUnitSize</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the size of  the data set in bytes. The server will check that this size matches exactly the size of the data definition provided in the  <I>DefineID</I> parameter. An exception will be returned if this is not the case. <BR><I>pDataSet</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to the data that is to be written.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>A data definition must be specified, using the  <A HREF="#SimConnect_AddToClientDataDefinition"><B>SimConnect_AddToClientDataDefinition</B></A> function, before data can be set. </p>
<H4>See Also</H4>
<UL type="disc">
  
  <li><A HREF="#SimConnect_AddToClientDataDefinition"><B>SimConnect_AddToClientDataDefinition</B></A></li>
  <li><A HREF="#SimConnect_ClearClientDataDefinition"><B>SimConnect_ClearClientDataDefinition</B></A></li>
  <li><A HREF="#SimConnect_CreateClientData"><B>SimConnect_CreateClientData</B></A></li>
  <li><b><a href="#SimConnect_MapClientDataNameToID">SimConnect_MapClientDataNameToID</a></b></li>
  <li><A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference</b></a></li>
</UL>
<hr><br>

<a name="SimConnect_SetDataOnSimObject"></a>
<h3>SimConnect_SetDataOnSimObject</h3>

<p>The <b>SimConnect_SetDataOnSimObject</b> function is used to make changes to the data properties of an object. </p>

<h4>Syntax</h4>

<code><b>HRESULT SimConnect_SetDataOnSimObject(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATA_DEFINITION_ID</b>&nbsp;&nbsp;<i>DefineID</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_OBJECT_ID</b>&nbsp;&nbsp;<i>ObjectID</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATA_SET_FLAG</b>&nbsp;&nbsp;<i>Flags</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>ArrayCount</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>cbUnitSize</i><b>,</b><br>

&nbsp;&nbsp;<b>void*</b>&nbsp;&nbsp;<i>pDataSet</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.
<br>

<i>DefineID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client defined
data definition.
<br>

<i>ObjectID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the <i>Flight
Simulator</i> object
that the data should be about. This ID can be <b>SIMCONNECT_OBJECT_ID_USER</b> (to specify the user's aircraft) or obtained from a&nbsp;<a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE"><b>SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</b></a>&nbsp;structure
after a call to <b><a href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>.</b><br>

<i>Flags</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Null, or one or more of the following flags.<br>
</p>

<table class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Flag</h5></td>
    <td><h5>Description</h5></td>
  </tr>
  <tr>
    <td><b>SIMCONNECT_DATA_SET_FLAG_TAGGED</b> </td>
    <td>The data to be set is being sent in tagged format. Refer to <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a> for more details on the tagged format. </td>
  </tr>
</table>
<p><br>

  <i>ArrayCount</i><br>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the number of elements in the data array.
A count of zero is interpreted as one element. <br>

<i>cbUnitSize</i><br>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the size of each element in the data array in bytes.</p>
<i>pDataSet</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to the data array.
<br>

<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>
<code>static enum DATA_DEFINE_ID {<br>
&nbsp;&nbsp;DEFINITION3<br>
};<br>
&nbsp;&nbsp;<br>
// Link DEFINITION3 with the SIMCONNECT_DATA_INITPOSITION structure<br>
<br>
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION3, "Initial Position", "NULL",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIMCONNECT_DATATYPE_INITPOSITION, 0);<br>
<br>
SIMCONNECT_DATA_INITPOSITION Init;<br>
&nbsp;&nbsp;  Init.Altitude = 5000.0;<br>
&nbsp;&nbsp;  Init.Latitude = 47.64210;<br>
&nbsp;&nbsp;  Init.Longitude = -122.13010;<br>
&nbsp;&nbsp;  Init.Pitch = -0.0;<br>
&nbsp;&nbsp;  Init.Bank = -1.0;<br>
&nbsp;&nbsp;  Init.Heading = 180.0;<br>
&nbsp;&nbsp;  Init.OnGround = 0;<br>
&nbsp;&nbsp;  Init.Airspeed = 0;<br>
<b>SimConnect_SetDataOnSimObject(hSimConnect, DEFINITION3, SIMCONNECT_OBJECT_ID_USER, 0, sizeof(Init), &amp;Init);</b></code>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#SetData">Set Data</a></p>
      <p><a href="#ThrottleControl">Throttle Control</a></p>
      <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td><a href="#AIObjectsandWaypoints">AI Objects and Waypoints </a></td>
  </tr>
</table>
<h4>Remarks</h4>
<p>The data that is set on an object is defined in a data definition (see the <a href="#SimConnect_AddToDataDefinition"><b>SimConnect_AddToDataDefinition</b></a> function). This data can include the following structures: <b><a href="#SIMCONNECT_DATA_WAYPOINT">SIMCONNECT_DATA_WAYPOINT</a></b>, <a style="font-weight: bold;" href="#SIMCONNECT_DATA_INITPOSITION">SIMCONNECT_DATA_INITPOSITION</a>, and <a href="#SIMCONNECT_DATA_MARKERSTATE"><span style="font-weight: bold;">SIMCONNECT_DATA_MARKERSTATE</span></a>. 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. </p>
<p>&nbsp;</p>
<p>The <a href="../Variables/Simulation Variables.html">Simulation Variables</a> 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. </p>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_AddToDataDefinition"><b>SimConnect_AddToDataDefinition</b></a></li>

  <li><a href="#SimConnect_ClearDataDefinition"><b>SimConnect_ClearDataDefinition</b></a></li>

  <li><a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a></li>

  <li><a href="#SimConnect_RequestDataOnSimObjectType"><b>SimConnect_RequestDataOnSimObjectType</b></a></li>

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference</b></a></li>
</ul>

<hr><br>

<a name="SimConnect_SetInputGroupPriority"></a>
<h3>SimConnect_SetInputGroupPriority</h3>

<p>The <b>SimConnect_SetInputGroupPriority</b> function
is used to set the priority for a specified input group object.</p>

<h4>Syntax</h4>

<code><b>HRESULT SimConnect_SetInputGroupPriority(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_INPUT_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>uPriority</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.
<br>

<i>GroupID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client defined input
group that the priority setting is to apply to.
<br>

<i>uPriority</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the priority
setting for the input group.&nbsp;See the explanation of <a href="#SimConnect_Priorities">SimConnect
Priorities</a>.</p>

<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>
<code><b>
hr=SimConnect_SetInputGroupPriority(hSimConnect,INPUT0,SIMCONNECT_GROUP_PRIORITY_HIGHEST);</b></code>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#InputEvent">Input Event </a></p>
        <p><a href="#JoystickInput">Joystick Input</a></p>
      <p>&nbsp;</p>    </td>
  </tr>
</table>
<h4>Remarks</h4><p>A priority setting must be made for all input groups,
otherwise event notifications will not be sent by the SimConnect server.</p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a> </li>

  <li><a href="#SimConnect_MapInputEventToClientEvent"><b>SimConnect_MapInputEventToClientEvent</b></a></li>

  <li><a href="#SimConnect_RemoveInputEvent"><b>SimConnect_RemoveInputEvent</b></a></li>

  <li><a href="#SimConnect_ClearInputGroup"><b>SimConnect_ClearInputGroup</b></a></li>

  <li><a href="#SimConnect_SetInputGroupState"><b>SimConnect_SetInputGroupState</b></a><br>
</li>
</ul>

<hr><br>

<a name="SimConnect_SetInputGroupState"></a>
<h3>SimConnect_SetInputGroupState</h3>

<p>The <b>SimConnect_SetInputGroupState</b> function is
used to&nbsp;turn requests for input event information from the
server on and off.</p>

<h4>Syntax</h4>

<code><b>HRESULT SimConnect_SetInputGroupState(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_INPUT_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>dwState</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.
<br>

<i>GroupID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client defined
input group that is to have its state changed.<br>

<i>dwState</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing the
new state. One member of the <a href="#SIMCONNECT_STATE"><span style="font-weight: bold;"></span><b>SIMCONNECT_STATE</b></a>
enumeration type.</p>

<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>

<code>static enum INPUT_ID {<br>

&nbsp; INPUT_1,<br>

&nbsp; INPUT_2<br>

};<br>

static enum EVENT_ID {<br>

&nbsp; EVENT_1,<br>

&nbsp; EVENT_2<br>

};<br>

....<br>


hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_1, "parking_brakes");<br>

hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1, "ctrl+U+Q",
EVENT_1);<br>

<span style="font-weight: bold;">hr =
SimConnect_SetInputGroupState(hSimConnect, INPUT_1,
SIMCONNECT_STATE_ON);</span><br>
</code>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#InputEvent">Input Event </a></p>
        <p><a href="#JoystickInput">Joystick Input</a></p>
      <p><a href="#ThrottleControl">Throttle Control</a></p>    </td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td><a href="#SetData">Set Data</a></td>
  </tr>
</table>
<h4>Remarks</h4>
<p>The default state for input groups is to be inactive, so
make
sure to call this function each time an input group is to become
active.</p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a> </li>

  <li><a href="#SimConnect_MapInputEventToClientEvent"><b>SimConnect_MapInputEventToClientEvent</b></a></li>

  <li><a href="#SimConnect_SetInputGroupPriority"><b>SimConnect_SetInputGroupPriority</b></a></li>

  <li><a href="#SimConnect_RemoveInputEvent"><b>SimConnect_RemoveInputEvent</b></a></li>

  <li><a href="#SimConnect_ClearInputGroup"><b>SimConnect_ClearInputGroup</b></a><BR>
  </li>
</ul>

<hr>
<br>
<a name="SimConnect_SetNotificationGroupPriority"></a>
<h3>SimConnect_SetNotificationGroupPriority</h3>
<p>The <b>SimConnect_SetNotificationGroupPriority</b> function is
  used to set the priority for a notification group.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_SetNotificationGroupPriority(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_NOTIFICATION_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>uPriority</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>GroupID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  group. <br>
  <i>uPriority</i><br>
  &nbsp;&nbsp;[in]&nbsp; Requests the group's
  priority.&nbsp;See the explanation of <a href="#SimConnect_Priorities">SimConnect Priorities</a>.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code><b>hr=SimConnect_SetNotificationGroupPriority(hSimConnect,GROUP0,SIMCONNECT_GROUP_PRIORITY_HIGHEST);</b></code>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#ClientEvent">Client Event</a></p>
        <p><a href="#SendEventA">Send Event A </a></p>
      <p><a href="#SendEventB">Send Event B</a></p>
      <p><a href="#SendEventC">Send Event C</a></p>
      <p><a href="#TrackingErrors">Tracking Errors </a></p></td>
  </tr>
</table>
<h4>Remarks</h4>
<p></p>
<h5><a name="SimConnect_Priorities"></a>SimConnect
  Priorities</h5>
<br>
SimConnect constants define the following priorities:
<p></p>
<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">
  <tbody>
    <tr>
      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Priority</span></td>
      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Value</span></td>
      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><code><b>SIMCONNECT_GROUP_PRIORITY_HIGHEST</b></code></td>
      <td align="undefined" valign="undefined">1</td>
      <td align="undefined" valign="undefined">The
        highest priority.</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><code><b>SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE</b></code></td>
      <td align="undefined" valign="undefined">10000000</td>
      <td align="undefined" valign="undefined">The
        hightest priority that allows events to be masked.</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><code><b>SIMCONNECT_GROUP_PRIORITY_STANDARD</b></code></td>
      <td align="undefined" valign="undefined">1900000000</td>
      <td align="undefined" valign="undefined">The
        standard priority.</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><code><b>SIMCONNECT_GROUP_PRIORITY_DEFAULT</b></code></td>
      <td align="undefined" valign="undefined">2000000000</td>
      <td align="undefined" valign="undefined">The
        default priority.</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><code><b>SIMCONNECT_GROUP_PRIORITY_LOWEST</b></code></td>
      <td align="undefined" valign="undefined">4000000000</td>
      <td align="undefined" valign="undefined">Priorities
        lower than this will be ignored.</td>
    </tr>
  </tbody>
</table>
<p></p>
<p>Each notifiction 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 recieved 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.</p>
<p><br>
  If a group has an assigned priority above <code><b>SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE</b></code>&nbsp;then
  it cannot mask events (hide them from other clients). If the group has a priority equal to or below <code><b>SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE</b></code>, then
  events can be masked (the maskable flag must be set by the&nbsp;<a href="#SimConnect_AddClientEventToNotificationGroup"><b>SimConnect_AddClientEventToNotificationGroup</b></a> function to do this). Note that it is possible to mask <i>Flight Simulator </i>events, and therefore intercept them before they reach the simulation engine, and perhaps send new events to the simulation engine after appropriate processing has been done. <i>Flight Simulator</i>'s simulation engine is treated as as SimConnect client in this regard, with a priority of  <code><b>SIMCONNECT_GROUP_PRIORITY_DEFAULT</b></code>.</p>
<p><br>
  Input  group events work in a similar manner. The priority groups
  are not combined though, a group and an input group can both have the
  same priority number. The SimConnect server manages two lists: notification
  groups and input groups. </p>
<p>&nbsp;</p>
<p>A typical use of masking is to prevent <i>Flight Simulator</i> itself from receiving an event, in order for the SimConnect client to completely replace the fucntionality in this case. Another use of masking is with co-operative clients, where there are multiple versions (perhaps a delux and standard version, or later and earlier versions), where the delux or later version might need to mask events from the other client, if they are both up and running. <i>Flight Simulator</i> does not mask any events. </p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_AddClientEventToNotificationGroup"><b>SimConnect_AddClientEventToNotificationGroup</b></a></li>
  <li><a href="#SimConnect_RemoveClientEvent"><b>SimConnect_RemoveClientEvent</b></a></li>
  <li><a href="#SimConnect_ClearNotificationGroup"><b>SimConnect_ClearNotificationGroup</b></a></li>
</ul>
<hr>
<br>
<a name="SimConnect_SetSystemEventState"></a>
<h3>SimConnect_SetSystemEventState</h3>
<p>The <b>SimConnect_SetSystemEventState</b> function is used
  to turn requests for event information from the server on and off.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_SetSystemEventState(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_CLIENT_EVENT_ID</b>&nbsp;&nbsp;<i>EventID</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_STATE</b>&nbsp;&nbsp;<i>dwState</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
    <i>EventID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client event that is to have its state changed. <br>
    <i>dwState</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing the
  state (one member of <a style="font-weight: bold;" href="#SIMCONNECT_STATE">SIMCONNECT_STATE</a>).</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<p>See the example and working samples for <a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a>.</p>
<h4>Remarks</h4>
<p>If 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. </p>
<p>&nbsp;</p>
<p>Use this function to turn system events temporarily on and off, rather than make multiple calls to <a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a> and <a href="#SimConnect_UnsubscribeFromSystemEvent"><b>SimConnect_UnsubscribeFromSystemEvent</b></a>, which is less efficient. </p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_MapClientEventToSimEvent"><b>SimConnect_MapClientEventToSimEvent</b></a></li>
  <li><a href="#SimConnect_TransmitClientEvent"></a><a href="#SimConnect_MapInputEventToClientEvent"><b>SimConnect_MapInputEventToClientEvent</b></a></li>
</ul>
<HR><BR>
<A NAME="SimConnect_SetSystemState"><H3>SimConnect_SetSystemState</H3></A>
The <B>SimConnect_SetSystemState</B> function is used to access a number of <i>Flight Simulator</i> system components.<BR>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_SetSystemState(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><BR>
&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>szState</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>dwInteger</i><b>,</b><br>
&nbsp;&nbsp;<b>float</b>&nbsp;&nbsp;<i>fFloat</i><b>,</b><br>
&nbsp;&nbsp;<b>char*</b>&nbsp;&nbsp;<i>szString</i><b>,</b><br>
<B>);</B></CODE><BR>
<CODE><BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
  &nbsp;&nbsp;Handle to a SimConnect object.<BR>
  <I>szState</I><BR>
  &nbsp;&nbsp;A null-terminated string identifying the system function. One from the following table: </p>
<p>&nbsp;</p>
<table width="500" class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>String</h5></td>
    <td><h5>Description</h5></td>
  </tr>
  <tr>
    <td><b>DialogMode</b></td>
    <td><p>The <i>dwInteger</i> parameter should be set to 1 to turn Dialog mode on, or 0 to turn it off. Dialog mode enables the display of dialogs when the simulation is running in Full Screen mode. When in dialog mode the 3D area of the screen will turn black, and will only revert to the simulation view when Dialog mode is turned off (not automatically when the dialog is closed). See the Working Sample for a simple example. </p>
    <p>It is safe to set and reset Dialog mode when the simulation is being run in Windows mode. </p></td>
  </tr>
  <tr>
    <td><b>FlightLoaded</b></td>
    <td>The <i>szString</i> parameter should contain the full path name of a flight. This will result in that flight, if it exists, being loaded. Flight files have the extension .FLT. </td>
  </tr>
  <tr>
    <td><b>Sim</b></td>
    <td>It is not possible to set this state, so entering this will result in an exception being returned. </td>
  </tr>
</table>
 <p>&nbsp;</p>
 <p><I>dwInteger</I><BR>
&nbsp;&nbsp;An integer value, set depending on the value of <i>szState</i> (not currently used).</p>
 <p><I>fFloat</I><BR>
&nbsp;&nbsp;A float value, set depending on the value of <i>szState</i> (not currently used).<BR>
   <I>szString</I><BR>
&nbsp;&nbsp;A string value, set depending on the value of <i>szState.</i></p>
 <H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR>
<table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5>
  <tr>
    <td><H5>Return value</H5></td>
    <td><H5>Description</H5></td>
  </tr>
  <tr>
    <td><p>S_OK</p></td>
    <td><p>The function succeeded. </p></td>
  </tr>
  <tr>
    <td><p>E_FAIL</p></td>
    <td><p>The function failed. </p></td>
  </tr>
</table>
<H4>Working Samples</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#DialogBoxMode">DialogBoxMode</a></p>
    </td>
  </tr>
</table>
<H4>Remarks</H4>
<p>The integer, float and string set with this function match those in the <a style="font-weight: bold;" href="#SIMCONNECT_RECV_SYSTEM_STATE">SIMCONNECT_RECV_SYSTEM_STATE</a> structure (which is returned if the information is requested with the <a href="#SimConnect_RequestSystemState"><b>SimConnect_RequestSystemState</b></a> call. </p>
<H4>See Also</H4>
<UL type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference</b></a></li>
  <li><b><a href="#SimConnect_SubscribeToSystemEvent">SimConnect_SubscribeToSystemEvent</a></b></li>
</UL>
<hr><br>
<a name="SimConnect_SubscribeToSystemEvent"></a>
<h3>SimConnect_SubscribeToSystemEvent</h3>

<p>The <b>SimConnect_SubscribeToSystemEvent</b>
function is used to request that a specific system event is notified to
the client.</p>

<h4>Syntax</h4>

<code><b>HRESULT SimConnect_SubscribeToSystemEvent(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_CLIENT_EVENT_ID</b>&nbsp;&nbsp;<i>EventID</i><b>,</b><br>

&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>SystemEventName</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.
<br>

<i>EventID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the
client-defined event ID.
<br>

<i>SystemEventName</i><br>

&nbsp;&nbsp;[in]&nbsp; The string name for the requested
system event, which should be one from the following table (note that the event names are not case-sensitive). Unless otherwise stated in the Description, notifications of the event are returned in a <b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b> structure (identify the event from the <i>EventID</i> given with this function). </p>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>System Event Name </h5></td>
    <td><h5>Description</h5></td>
  </tr>
  <tr>
    <td><h6>General events </h6></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>1sec</b></td>
    <td>Request a notification every second. </td>
  </tr>
  <tr>
    <td><b>4sec</b></td>
    <td>Request a notification every four seconds. </td>
  </tr>
  <tr>
    <td><b>6Hz</b></td>
    <td>Request notifications six times per second. This is the same rate that joystick movement events are transmitted. </td>
  </tr>
  <tr>
    <td><b>AircraftLoaded</b></td>
    <td>Request a notification when the aircraft flight dynamics file is changed. These files have a .AIR extension. The filename  is returned in a <a href="#SIMCONNECT_RECV_EVENT_FILENAME"><b>SIMCONNECT_RECV_EVENT_FILENAME</b></a> structure. </td>
  </tr>
  <tr>
    <td><b>Crashed</b></td>
    <td>Request a notification if the user aircraft crashes. </td>
  </tr>
  <tr>
    <td><b>CrashReset</b></td>
    <td>Request a notification when the crash cut-scene has completed. </td>
  </tr>
  <tr>
    <td><b>FlightLoaded</b></td>
    <td>Request a notification when a flight is loaded. Note that when a flight is ended, a default flight is typically loaded, so these events will occur when flights and missions are started and finished. The filename of the flight loaded is returned in a <a href="#SIMCONNECT_RECV_EVENT_FILENAME"><b>SIMCONNECT_RECV_EVENT_FILENAME</b></a> structure. </td>
  </tr>
  <tr>
    <td><b>FlightSaved</b></td>
    <td>Request a notification when a flight is saved correctly. The filename of the flight saved is returned in a <a href="#SIMCONNECT_RECV_EVENT_FILENAME"><b>SIMCONNECT_RECV_EVENT_FILENAME</b></a> structure. </td>
  </tr>
  <tr>
    <td><b>FlightPlanActivated</b></td>
    <td>Request a notification when a new flight plan is activated. The filename of the activated flight plan is returned in a <a href="#SIMCONNECT_RECV_EVENT_FILENAME"><b>SIMCONNECT_RECV_EVENT_FILENAME</b></a> structure. </td>
  </tr>
  <tr>
    <td><b>FlightPlanDeactivated</b></td>
    <td>Request a notification when the active flight plan is de-activated. </td>
  </tr>
  <tr>
    <td><b>Frame</b></td>
    <td>Request notifications every visual frame. Information is returned in a <A HREF="#SIMCONNECT_RECV_EVENT_FRAME"><B>SIMCONNECT_RECV_EVENT_FRAME</B></A> structure. </td>
  </tr>
  <tr>
    <td><b>Pause</b></td>
    <td>Request notifications when the flight is paused or unpaused, and also immediately returns the current pause state (1 = paused or 0 = unpaused). The state is returned in the <i>dwData</i> parameter. </td>
  </tr>
  <tr>
    <td><b>Paused</b></td>
    <td>Request a notification when the flight is paused. </td>
  </tr>
  <tr>
    <td><b>PauseFrame</b></td>
    <td>Request notifications for every visual frame that the simulation is paused. Information is returned in a <A HREF="#SIMCONNECT_RECV_EVENT_FRAME"><B>SIMCONNECT_RECV_EVENT_FRAME</B></A> structure. </td>
  </tr>
  
  <tr>
    <td><b>PositionChanged</b></td>
    <td>Request a notification when the user changes the position of their aicraft through a dialog. </td>
  </tr>
  <tr>
    <td><b>Sim</b></td>
    <td>Request notifications when the  flight is running or not, and also immediately returns the current  state (1 = running or 0 = not running). The state is returned in the <i>dwData</i> parameter. </td>
  </tr>
  <tr>
    <td><b>SimStart</b></td>
    <td>The simulator is running. Typically the user is actively controlling the aircraft  on the ground or in the air. </td>
  </tr>
  <tr>
    <td><b>SimStop</b></td>
    <td>The simulator is not running. Typically the user is loading a flight, navigating the shell or in a dialog.</td>
  </tr>
  <tr>
    <td><b>Sound</b></td>
    <td>Requests a notification when the master sound switch is changed. This request will also return the current state of the master sound switch immediately. A flag is returned in the <i>dwData</i> parameter, 0 if the switch is off, <b>SIMCONNECT_SOUND_SYSTEM_EVENT_DATA_MASTER</b> (0x1) if the switch is on. </td>
  </tr>
  <tr>
    <td><b>Unpaused</b></td>
    <td>Request a notification when the flight is un-paused. </td>
  </tr>
  <tr>
    <td><b>View</b></td>
    <td><p>Requests a notification when the user aircraft view is changed. This request will also return the current view immediately. A flag is returned in the <i>dwData</i> parameter, one of: </p>
      <p><b>SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_2D</b></p>
    <p><b>SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_VIRTUAL</b></p>
    <p><b>SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_ORTHOGONAL</b> (the map view). </p></td>
  </tr>
  <tr>
    <td><b>WeatherModeChanged</b></td>
    <td>Request a notification when the weather mode is changed. </td>
  </tr>
  <tr>
    <td><h6>AI Specific events </h6></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ObjectAdded </b></td>
    <td>Request a notification when an AI object is added to the simulation. Refer also to the <b><a href="#SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE">SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE</a></b> structure. </td>
  </tr>
  <tr>
    <td><b>ObjectRemoved </b></td>
    <td>Request a notification when an AI object is removed from the simulation. Refer also to the <b><a href="#SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE">SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE</a></b> structure. </td>
  </tr>
  
  <tr>
    <td><h6>Mission Specific events </h6></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>MissionCompleted</b></td>
    <td>Request a notification when the user has completed a mission. Refer also to the <b><a href="#SIMCONNECT_MISSION_END">SIMCONNECT_MISSION_END</a></b> enum. </td>
  </tr>
  <tr>
    <td><b>CustomMissionActionExecuted</b></td>
    <td>Request a notification when a mission action has been executed. Refer also to the <b><a href="#SimConnect_CompleteCustomMissionAction">SimConnect_CompleteCustomMissionAction</a></b> function. </td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>

<p><code>
  static enum EVENT_ID {<br>
  &nbsp; &nbsp;EVENT_FLIGHT_LOAD,<br>
  &nbsp; &nbsp;EVENT_RECUR_1SEC,<br>
  &nbsp; &nbsp;EVENT_RECUR_FRAME,
  <br>
  
  };<br>
  
</code><code><b>hr =
SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_FLIGHT_LOAD,
"FlightLoaded");</b></code></p>
<p><code><b>hr =
  SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_RECUR_1SEC,
  &nbsp;"1sec");</b><br>
  
  <b>hr = SimConnect_SubscribeToSystemEvent(hSimConnect,
    EVENT_RECUR_FRAME,
  "frame");<br>
    
  <br>
  </b>// The recurring events will be on by default, so set one of
  them to off.<b><br>
    
  </b>hr = SimConnect_SetSystemEventState(hSimConnect, EVENT_RECUR_FRAME,
  SIMCONNECT_STATE_OFF);<b><br>
    
  </b></code></p>
<h4>Working Samples</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#MissionAction">Mission Action </a></p>
      <p><a href="#SystemEvent">System Event </a></p>    </td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td>Many of the other <a href="#WorkingSamples">samples</a> implement this function. </td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Remarks</h4>
<p>A single call to this function is all that is neccessary to receive the notifications. For greatest efficiency use <b><a href="#SimConnect_SetSystemEventState">SimConnect_SetSystemEventState</a></b> to turn these requests on and off termporarily, and call <a href="#SimConnect_UnsubscribeFromSystemEvent"><b>SimConnect_UnsubscribeFromSystemEvent</b></a> once only to permanently terminate the notifications of these events. </p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_RequestSystemState"><b>SimConnect_RequestSystemState</b></a></li>

  <li><b><a href="#SimConnect_SetSystemState">SimConnect_SetSystemState</a></b></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference</b></a> </li>
</ul>

<hr>
<br>
<a name="SimConnect_TransmitClientEvent"></a>
<h3>SimConnect_TransmitClientEvent</h3>
<p>The <b>SimConnect_TransmitClientEvent</b> function is used
  to request that the <i>Flight Simulator</i> server
  transmit to all SimConnect clients  the specified client event.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_TransmitClientEvent(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_OBJECT_ID</b>&nbsp;&nbsp;<i>ObjectID</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_CLIENT_EVENT_ID</b>&nbsp;&nbsp;<i>EventID</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>dwData</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_NOTIFICATION_GROUP_ID</b>&nbsp;&nbsp;<i>GroupID</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_EVENT_FLAG</b>&nbsp;&nbsp;<i>Flags</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>ObjectID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the server defined object.
  If this parameter is set to <b>SIMCONNECT_OBJECT_ID_USER</b>, then the transmitted event will be sent to the other clients in priority order. If this parameters  contains another object ID, then the event will be sent direct to that sim-object, and no other clients will receive it. <br>
  <i>EventID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client event. <br>
  <i>dwData</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing any
  additional number required by the event. This is often zero. If the event is a <i>Flight Simulator</i> event, then refer
  to the <a href="../Variables/Event IDs.htm">Event IDs</a> document for information on this additional
  value. If the event is a custom event, then any value put in this parameter will be available to the clients that receive the event. <br>
  <i>GroupID</i> <br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;The default behavior is that this specifies the GroupID of the
  event. The SimConnect server will use the priority of this group to send the messasge to all clients with a lower priority. To receive the event notification other SimConnect
  clients must have subscribed to receive the event.&nbsp; See the explanation of <a href="#SimConnect_Priorities">SimConnect
    Priorities</a>.
  The exception to the default behaviour is set by the <b>SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY</b> flag, described below. <br>
  <i>Flags</i><br>
  &nbsp;&nbsp;[in]&nbsp;One or more of the following flags: </p>
<p>&nbsp; </p>
<table width="800" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h6>Flag</h6></td>
    <td><h6>Description</h6></td>
  </tr>
  <tr>
    <td><b>0</b></td>
    <td>Do nothing. </td>
  </tr>
  <tr>
    <td><span style="font-weight: bold;">SIMCONNECT_EVENT_FLAG_SLOW_REPEAT_TIMER</span></td>
    <td>The flag will effectively reset the repeat timer to simulate slow repeat. Use this flag to reset the repeat timer that works with various keyboard events and mouse clicks.</td>
  </tr>
  <tr>
    <td><span style="font-weight: bold;">SIMCONNECT_EVENT_FLAG_FAST_REPEAT_TIMER</span></td>
    <td>The flag will effectively reset the repeat timer to simulate fast repeat. </td>
  </tr>
  <tr>
    <td><b>SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY</b><BR></td>
    <td>Indicates to the SimConnect server   to treat the <i>GroupID</i> as a priority value.   If this parameter is set to SIMCONNECT_GROUP_PRIORITY_HIGHEST then all client notification groups that have subscribed to the event will receive the notification (unless one of them masks it). The event will be transmitted to clients starting at the given priority, though this can result in the client that transmitted the event, receiving it again. </td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Examples</h4>
<code> <br>
// 1. Transmitting a custom event to other clients<br>
static enum EVENT_ID {<br>
  &nbsp;EVENT_MY_EVENT<br>
  &nbsp;EVENT_DME<br>
  };<br>
hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_MY_EVENT, "Custom.Event");<br>
// Send EVENT_MY_EVENT to all current SimConnect clients.<br>
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_MY_EVENT, 0, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);<br><br>

// 2. Setting an event value in Flight Simulator<br>
hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_DME, "DME_SELECT");<br>
// Set the selected DME to 2<br>
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_DME, 2, SIMCONNECT_GROUP_PRIORITY_DEFAULT, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);<br>
<br>
</code>
<h4>Working Sample</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample </h5></td>
    <td><p><a href="#SendEventA">Send Event A </a></p></td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>Remarks</h4>
<p>Typically use this function to transmit an event to other SimConnect clients, including the simulation engine of <i>Flight Simulator</i>, 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 <b><i>maskable</i></b> parameter for  the <a href="#SimConnect_AddClientEventToNotificationGroup"><b>SimConnect_AddClientEventToNotificationGroup</b></a> call, which describes when the event may be masked and not transmitted to lower priority groups. &nbsp;Also see the explanation of <a href="#SimConnect_Priorities">SimConnect
  Priorities</a>. </p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
  <li><a href="#SimConnect_MapClientEventToSimEvent"><b>SimConnect_MapClientEventToSimEvent</b></a><br>
</li>
</ul>
<hr><br>

<a name="SimConnect_UnsubscribeFromSystemEvent"></a>
<h3>SimConnect_UnsubscribeFromSystemEvent</h3>

<p>The <b>SimConnect_UnsubscribeFromSystemEvent</b>
function is used to request that notifications are no longer received
for the specified system event.</p>

<h4>Syntax</h4>

<code><b>HRESULT SimConnect_UnsubscribeFromSystemEvent(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_CLIENT_EVENT_ID</b>&nbsp;&nbsp;<i>EventID</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.
<br>

<i>EventID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the
client-defined event ID.</p>

<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>

<p><code>
  static enum EVENT_ID {<br>
  &nbsp; &nbsp;EVENT_FLIGHT_LOAD,<br>
  &nbsp; &nbsp;EVENT_RECUR_1SEC,<br>
  &nbsp; &nbsp;EVENT_RECUR_FRAME,
  <br>
  
  };<br>
  
</code></p>
<p><code>hr =
  SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_RECUR_1SEC);</code></p>
<p><code>...</code><code></code></p>
<p><code><b>hr = SimConnect_UnsubscribeFromSystemEvent(hSimConnect,
    EVENT_RECUR_1SEC);</b></code></p>
<h4>Remarks</h4>
<p>There 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.</p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a></li>

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference</b></a><br>
</li>
</ul>

<hr>
<h2>Helper Functions<a name="HelperFunctions"></a><br>

  <a name="SimConnect_InsertString"></a></h2>
<h3>SimConnect_InsertString</h3>

<p>The <b>SimConnect_InsertString</b> function is used to assist in adding variable length strings to a structure. </p>

<h4>Syntax</h4>

<code><b>HRESULT SimConnect_InsertString(</b><br>

&nbsp;&nbsp;<b>char*</b>&nbsp;&nbsp;<i>pDest</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>cbDest</i><b>,</b><br>

&nbsp;&nbsp;<b>void**</b>&nbsp;&nbsp;<i>ppEnd</i><b>,</b><br>

&nbsp;&nbsp;<b>DWORD*</b>&nbsp;&nbsp;<i>pcbStringV</i><b>,</b><br>

&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>pSource</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>pDest</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to where the source string is to be written in the destination object.
<br>

<i>cbDest</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;The size of the remaining space in the destination object.
<br>

<i>ppEnd</i><br>

&nbsp;&nbsp;[in,out]&nbsp;&nbsp;Pointer to a pointer, (usually a pointer to a char pointer). On return the pointer locates the 
end of the string in the structure, and hence the starting position for any other string to be included in the structure.<br>

<i>pcbStringV</i><br>

&nbsp;&nbsp;[in,out]&nbsp;&nbsp;Pointer to a DWORD. On returning this DWORD will contain the size of the source string in bytes.
<br>

<i>pSource</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to the source string.</p>

<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Remarks</h4>

<p>This 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 <a href="#SimConnect_RetrieveString"><b>SimConnect_RetrieveString</b></a> function. </p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference</b></a></li>

  <li><a href="#SimConnect_RetrieveString"><b>SimConnect_RetrieveString</b></a><br>
  </li>
</ul>
<hr>
<br>
<a name="SimConnect_RequestResponseTimes"></a>
<h3>SimConnect_RequestResponseTimes</h3>
<p>The <b>SimConnect_RequestResponseTimes</b> function is used to
  provide some data on the performance of the client-server connection.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_RequestResponseTimes(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>nCount</i><b>,</b><br>
&nbsp;&nbsp;<b>float*</b>&nbsp;&nbsp;<i>fElapsedSeconds</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>nCount</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Integer containing the
  number of elements in the array of floats.
  This should be set to five for the full range of timings, but can be less if only the first few are of interest. There is no point creating an array of greater than five floats. <br>
  <i>fElapsedSeconds</i><br>
  &nbsp;&nbsp;[in]&nbsp; An array of <i>nCount</i> floats, containing the
  times. The five elements will contain the following: 0 - total round trip time, 1 - time from the request till the packet is sent, 2 - time from the request till the packet is received by the server, 3 - time from the request till the response is made by the server, 4 - time from the server response to the client receives the packet. </p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code> int quit = 0;<br>
bool fTesting = true;<br>
....<br>
while( quit == 0 )<br>
{<br>
&nbsp;hr = SimConnect_CallDispatch(hSimConnect, MyDispatchProc, NULL);<br>
&nbsp; Sleep(0);<br>
&nbsp; if (fTesting)<br>
&nbsp; {<br>
&nbsp; &nbsp; fTesting = false;<br>
&nbsp; &nbsp; float fElapsedSeconds[5];<br>
&nbsp; &nbsp; <b>hr = SimConnect_RequestResponseTimes(hSimConnect, 5,
&amp;fElapsedSeconds[0]);</b><br>
&nbsp; &nbsp; \\ Enter code to display the contents of
fElapsedSeconds<br>
&nbsp; }<br>
}<br>
</code>
<h4>Remarks</h4>
<p>This function should not be used as part of
  &nbsp;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.</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a> </li>
</ul>
<HR>
<br>
<a name="SimConnect_RetrieveString"></a>
<h3>SimConnect_RetrieveString</h3>
<p>The <b>SimConnect_RetrieveString</b> function is used to assist in retrieving varaible length strings from a structure.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_RetrieveString(</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_RECV*</b>&nbsp;&nbsp;<i>pData</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>cbData</i><b>,</b><br>
&nbsp;&nbsp;<b>void*</b>&nbsp;&nbsp;<i>pStringV</i><b>,</b><br>
&nbsp;&nbsp;<b>char**</b>&nbsp;&nbsp;<i>ppszString</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD*</b>&nbsp;&nbsp;<i>pcbString</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>pData</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to a <b>SIMCONNECT_RECV</b> structure, containing the data. <br>
  <i>cbData</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;The size of the structure that inherits the <b>SIMCONNECT_RECV</b> structure, in bytes. <br>
  <i>pStringV</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Pointer to a the start of the variable length string within the structure. <br>
  <i>ppszString</i><br>
  &nbsp;&nbsp;[in, out]&nbsp;&nbsp;Specifies a pointer to a pointer to a character buffer that should be large enough to contain the maximum length of string that might be returned. On return this buffer should contain the retrieved string. <br>
  <i>pcbString</i><br>
  &nbsp;&nbsp;[in, out]&nbsp;&nbsp;Pointer to a DWORD. On return this contains the length of
  the string in bytes.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code> struct StructVS {<br>
&nbsp;&nbsp;char	title[1];<br>
}<br>
StructVS *pS = (StructVS*)&pObjData->dwData;<br>
char *pszTitle;<br>
DWORD cbTitle;<br>
<b>hr = SimConnect_RetrieveString(pData, cbData, &pS->strings, &pszTitle, &cbTitle)))</b><br>
</code>
<h4>Working Sample</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#VariableStrings">Variable Strings </a></p></td>
  </tr>
</table>
<h4>Remarks</h4>
<p>This 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 <a href="#SimConnect_RetrieveString"></a> <a href="#SimConnect_InsertString"><b>SimConnect_InsertString</b></a> function. Note that this function works in the case where an empty string is in the structure returned by the server. </p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference</b></a></li>
  <li><a href="#SimConnect_InsertString"><b>SimConnect_InsertString</b></a></li>
</ul>
<HR>
<h2>AI Object Specific Functions<a name="AIObjectSpecificFunctions"></a></h2>

<A NAME="SimConnect_AICreateEnrouteATCAircraft"></A>
<H3>SimConnect_AICreateEnrouteATCAircraft</H3>
<p>The <B>SimConnect_AICreateEnrouteATCAircraft</B> function is used to create an AI controlled aircraft that is about to start or is already underway on its flight plan.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_AICreateEnrouteATCAircraft(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szContainerTitle</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szTailNumber</I><B>,</B><BR>
&nbsp;&nbsp;<B>int</B>&nbsp;&nbsp;<I>iFlightNumber</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szFlightPlanPath</I><B>,</B><BR>
&nbsp;&nbsp;<B>double</B>&nbsp;&nbsp;<I>dFlightPlanPosition</I><B>,</B><BR>
&nbsp;&nbsp;<B>BOOL</B>&nbsp;&nbsp;<I>bTouchAndGo</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>szContainerTitle</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the container title.
The container title is found in the aircraft.cfg file (see the <a href="../../SimObject Creation Kit/SimObject Container SDK/Aircraft Configuration Files.htm">Aircraft Configuation Files </a>document): for example:  <b>title=Airbus A321, title= Aircreation582SL,</b> or  <b>title=Boeing 737-800</b>.<br>
<I>szTailNumber</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the tail number.
This should have a maximum of 12 characters. <BR><I>iFlightNumber</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Integer containing the flight number.
There is no specific maximum length of this number. Any negative number indicates that there is no flight number. <BR>
<I>szFlightPlanPath</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the path to the flight plan file. Flight plans have the extension .pln, but no need to enter an extension here. The easiest way to create flight plans is to create them from within <i>Flight Simulator</i> itself, and then save them off for use with the AI controlled aircraft.
There is no need to enter the full path to the file (just enter the filename) if the flight plan is in the default <i>Flight Simulator X Files</i> directory. <BR>
<I>dFlightPlanPosition</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Double floating point number containing the flight plan position. The number before the point contains the waypoint index, and the number afterwards how far along the route to the next waypoint the aircraft is to be positioned. The first waypoint index is 0. For example, <b>0.0</b> indicates that the aircraft has not started on the flight plan,<b> 2.5</b> would indicate the aircraft is to be initialized halfway between the third and fourth waypoints (which would have indexes 2 and 3). The waypoints are those recorded in the flight plan, which may just be two airports, and do not include any taxiway points on the ground. Also there is a threshold that will ignore requests to have an aircraft taxiing or taking off, or landing. So set the value after the point to ensure the aircraft will be in level flight. See the section on <a href="#AircraftFlightPlans">Aircraft Flight Plans</a>.<BR>
<I>bTouchAndGo</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Flag, <b>True</b> indicating that landings should be touch and go, and not full stop landings.
<BR>
<I>RequestID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined request ID.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.

</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#AITraffic">AI Traffic </a></p>    </td>
  </tr>
</table>
<H4>Remarks</H4>
<p>An 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 <b>SIMCONNECT_EXCEPTION_CREATE_AIRCRAFT_FAILED</b>, apply to AI objects (refer to the <b><a href="#SIMCONNECT_EXCEPTION">SIMCONNECT_EXCEPTION</a></b> enum for more details). </p>
<p>&nbsp;</p>
<p>A <a href="#"><b>SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE</b></a> event notification can be subscribed to (see the <b><a href="#SimConnect_SubscribeToSystemEvent">SimConnect_SubscribeToSystemEvent</a></b> function), which will return a <b><a href="#SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE">SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE</a></b> structure whenever any client, including the one making the change, successfully adds or removes an AI controlled object. </p>
<p>&nbsp;</p>
<p>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 helicopte, 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 <A HREF="#SimConnect_AICreateSimulatedObject"><B>SimConnect_AICreateSimulatedObject</B></A>.</p>
<p>&nbsp;</p>
<p>For float-planes the recommended procedure is to control them using waypoints, and not the ATC system, as there is no concept of a &quot;parking space&quot; 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 <A HREF="#SimConnect_AICreateNonATCAircraft"><B>SimConnect_AICreateNonATCAircraft</B></A><A HREF="#SimConnect_AICreateSimulatedObject"></A> call.</p>
<p>&nbsp;</p>
<h5>The Reality Bubble<a name="TheRealityBubble"></a></h5>
<p>In order to improve the performance of Flight Simulator, 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 &quot;reality bubble&quot;) 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. </p>
<p>&nbsp;</p>
<table width=450 class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><div align="center"><img src="Images/Reality1.jpg"></div></td>
  </tr>
  <tr>
    <td><div align="center"><img src="Images/Reality2.jpg"></div></td>
  </tr>
</table>
<p>&nbsp;</p>
<p>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 <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a> function). Consider using the <a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a> function to request notifications for &quot;<b>ObjectRemoved</b>&quot; to test for these situations. No automatic notification is given when information is requested on an object, and then subsequently that object is removed. </p>
<p>&nbsp;</p>
<h5>Aircraft Flight Plans<a name="AircraftFlightPlans"></a></h5>
<p>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 <i>Flight Simulator</i> or created directly in XML, matching the required format. The simplest flight plan will contain only the departure and destination airports.</p>
<p>&nbsp; </p>
<table class="T1"><tr><td><p><code> &lt;?xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"?&gt;<br>
  
        <br>
  &lt;SimBase.Document&nbsp;Type="AceXML"&nbsp;version="1,0"&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&lt;Descr&gt;AceXML&nbsp;Document&lt;/Descr&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&lt;WorldBase.FlightPlan&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Title&gt;KSEA&nbsp;to&nbsp;KSFO&lt;/Title&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;FPType&gt;IFR&lt;/FPType&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;RouteType&gt;HighAlt&lt;/RouteType&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;CruisingAlt&gt;31000&lt;/CruisingAlt&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DepartureID&gt;KSEA&lt;/DepartureID&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DepartureLLA&gt;N47&nbsp;25'&nbsp;53.27",W122&nbsp;18'&nbsp;28.83",+000433.00&lt;/DepartureLLA&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DestinationID&gt;KSFO&lt;/DestinationID&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DestinationLLA&gt;N37&nbsp;36'&nbsp;26.00",W122&nbsp;22'&nbsp;49.59",+000013.00&lt;/DestinationLLA&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Descr&gt;KSEA,&nbsp;KSFO&lt;/Descr&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DeparturePosition&gt;34R&lt;/DeparturePosition&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DepartureName&gt;Seattle-Tacoma&nbsp;Intl&lt;/DepartureName&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DestinationName&gt;San&nbsp;Francisco&nbsp;Intl&lt;/DestinationName&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;AppVersion&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;AppVersionMajor&gt;10&lt;/AppVersionMajor&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;AppVersionBuild&gt;60327&lt;/AppVersionBuild&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/AppVersion&gt;</code></p>
      <p><code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypoint&nbsp;id="KSEA"&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypointType&gt;Airport&lt;/ATCWaypointType&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;WorldPosition&gt;N47&nbsp;25'&nbsp;53.27",W122&nbsp;18'&nbsp;28.83",+000433.00&lt;/WorldPosition&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAOIdent&gt;KSEA&lt;/ICAOIdent&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ATCWaypoint&gt;</code></p>
      <p><code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypoint&nbsp;id="SEA"&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypointType&gt;VOR&lt;/ATCWaypointType&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;WorldPosition&gt;N47&nbsp;26'&nbsp;7.36",W122&nbsp;18'&nbsp;34.59",+000000.00&lt;/WorldPosition&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAORegion&gt;K1&lt;/ICAORegion&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAOIdent&gt;SEA&lt;/ICAOIdent&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ATCWaypoint&gt;</code></p>
      <p><code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypoint&nbsp;id="LMT"&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypointType&gt;VOR&lt;/ATCWaypointType&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;WorldPosition&gt;N42&nbsp;9'&nbsp;11.34",W121&nbsp;43'&nbsp;39.10",+000000.00&lt;/WorldPosition&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCAirway&gt;J65&lt;/ATCAirway&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAORegion&gt;K1&lt;/ICAORegion&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAOIdent&gt;LMT&lt;/ICAOIdent&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ATCWaypoint&gt;</code></p>
      <p><code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypoint&nbsp;id="RBL"&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypointType&gt;VOR&lt;/ATCWaypointType&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;WorldPosition&gt;N40&nbsp;5'&nbsp;56.07",W122&nbsp;14'&nbsp;10.88",+000000.00&lt;/WorldPosition&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCAirway&gt;J65&lt;/ATCAirway&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAORegion&gt;K2&lt;/ICAORegion&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAOIdent&gt;RBL&lt;/ICAOIdent&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ATCWaypoint&gt;</code></p>
      <p><code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypoint&nbsp;id="OAK"&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypointType&gt;VOR&lt;/ATCWaypointType&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;WorldPosition&gt;N37&nbsp;43'&nbsp;33.30",W122&nbsp;13'&nbsp;24.92",+000000.00&lt;/WorldPosition&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCAirway&gt;J3&lt;/ATCAirway&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAORegion&gt;K2&lt;/ICAORegion&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAOIdent&gt;OAK&lt;/ICAOIdent&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ATCWaypoint&gt;</code></p>
      <p><code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypoint&nbsp;id="KSFO"&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ATCWaypointType&gt;Airport&lt;/ATCWaypointType&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;WorldPosition&gt;N37&nbsp;36'&nbsp;26.00",W122&nbsp;22'&nbsp;49.59",+000013.00&lt;/WorldPosition&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ICAOIdent&gt;KSFO&lt;/ICAOIdent&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ICAO&gt;<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ATCWaypoint&gt;</code></p>
      <p><code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&lt;/WorldBase.FlightPlan&gt;<br>
  &lt;/SimBase.Document&gt;<br>
        
                                    </code></p></td></tr></table>

<p>&nbsp;</p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SimConnect_AICreateNonATCAircraft"><B>SimConnect_AICreateNonATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateParkedATCAircraft"><B>SimConnect_AICreateParkedATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateSimulatedObject"><B>SimConnect_AICreateSimulatedObject</B></A></li>
<li><A HREF="#SimConnect_AIRemoveObject"><B>SimConnect_AIRemoveObject</B></A></li>
<li><A HREF="#SimConnect_AISetAircraftFlightPlan"><B>SimConnect_AISetAircraftFlightPlan</B></A></li>
<li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_AICreateNonATCAircraft"></A><H3>SimConnect_AICreateNonATCAircraft</H3>
<p>The <B>SimConnect_AICreateNonATCAircraft</B> function is used to create an aircraft that is not flying under ATC control (so is typically flying under VFR rules).</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_AICreateNonATCAircraft(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szContainerTitle</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szTailNumber</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_INITPOSITION</B>&nbsp;&nbsp;<I>InitPos</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>szContainerTitle</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the container title.
The container title is case-sensitive and can be found in the aircraft.cfg file (see the <a href="../../SimObject Creation Kit/SimObject Container SDK/Aircraft Configuration Files.htm">Aircraft Configuation Files</a> document): for example: <b>title=Airbus A321, title= Aircreation582SL,</b> or <b>title=Boeing 737-800</b>.<br>
<I>szTailNumber</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the tail number.
This should have a maximum of 12 characters. <BR><I>InitPos</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the initial position, using a <b><a href="#SIMCONNECT_DATA_INITPOSITION">SIMCONNECT_DATA_INITPOSITION</a></b> structure.<BR>
<I>RequestID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined request ID.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><a href="#AIObjectsandWaypoints">AI Objects and Waypoints </a></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>A non-ATC aircraft can be on the ground or airborne when it is created by this function. A number of errors, including <b>SIMCONNECT_EXCEPTION_CREATE_AIRCRAFT_FAILED</b>, apply to AI objects (refer to the <b><a href="#SIMCONNECT_EXCEPTION">SIMCONNECT_EXCEPTION</a></b> enum for more details).</p>
<p>&nbsp;</p>
<p>Refer to the remarks for  <A HREF="#SimConnect_AICreateEnrouteATCAircraft"><B>SimConnect_AICreateEnrouteATCAircraft</B></A>.</p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SimConnect_AICreateEnrouteATCAircraft"><B>SimConnect_AICreateEnrouteATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateParkedATCAircraft"><B>SimConnect_AICreateParkedATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateSimulatedObject"><B>SimConnect_AICreateSimulatedObject</B></A></li>
<li><A HREF="#SimConnect_AIRemoveObject"><B>SimConnect_AIRemoveObject</B></A></li>
<li><A HREF="#SimConnect_AISetAircraftFlightPlan"><B>SimConnect_AISetAircraftFlightPlan</B></A></li>
<li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_AICreateParkedATCAircraft"></A><H3>SimConnect_AICreateParkedATCAircraft</H3>
<p>The <B>SimConnect_AICreateParkedATCAircraft</B> function is used to create an AI controlled aircraft that is currently parked and does not have a flight plan.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_AICreateParkedATCAircraft(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szContainerTitle</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szTailNumber</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szAirportID</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>szContainerTitle</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the container title.
The container title is case-sensitive and can found in the aircraft.cfg file (see the <a href="../../SimObject Creation Kit/SimObject Container SDK/Aircraft Configuration Files.htm">Aircraft Configuation Files</a> document): for example: <b>title=Airbus A321, title= Aircreation582SL,</b> or <b>title=Boeing 737-800</b>. <br>
<I>szTailNumber</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the tail number.
This should have a maximum of 12 characters. <BR><I>szAirportID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the airport ID. This is the ICAO identification string, for example, KSEA for SeaTac International. <BR>
<I>RequestID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined request ID.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#AITraffic">AI Traffic </a></p></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>Calling this function is no guarrantee 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 <b>SIMCONNECT_EXCEPTION_CREATE_AIRCRAFT_FAILED</b>, apply to AI objects (refer to the <b><a href="#SIMCONNECT_EXCEPTION">SIMCONNECT_EXCEPTION</a></b> enum for more details). After creating an aircraft with this function, a call to <A HREF="#SimConnect_AISetAircraftFlightPlan"><B>SimConnect_AISetAircraftFlightPlan</B></A> will set the aircraft in motion. Refer to the remarks for  <A HREF="#SimConnect_AICreateEnrouteATCAircraft"><B>SimConnect_AICreateEnrouteATCAircraft</B></A>.</p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SimConnect_AICreateEnrouteATCAircraft"><B>SimConnect_AICreateEnrouteATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateNonATCAircraft"><B>SimConnect_AICreateNonATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateSimulatedObject"><B>SimConnect_AICreateSimulatedObject</B></A></li>
<li><A HREF="#SimConnect_AIRemoveObject"><B>SimConnect_AIRemoveObject</B></A></li>
<li><A HREF="#SimConnect_AISetAircraftFlightPlan"><B>SimConnect_AISetAircraftFlightPlan</B></A></li>
<li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_AICreateSimulatedObject"></A><H3>SimConnect_AICreateSimulatedObject</H3>
<p>The <B>SimConnect_AICreateSimulatedObject</B> function is used to create AI controlled objects other than aircraft.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_AICreateSimulatedObject(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szContainerTitle</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_INITPOSITION</B>&nbsp;&nbsp;<I>InitPos</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR><I>szContainerTitle</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the container title. The container title is case-sensitive and can be found in the sim.cfg file, for example:</p>
<p>&nbsp; </p>
<table width="800" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Object Types </h5></td>
    <td><h5>Examples</h5></td>
  </tr>
  <tr>
    <td>Ground Vehicles </td>
    <td> <b>title=Automobile<br>
      title=FuelTruck<br>
      title=VEH_air_bagcart1<br>
    title=VEH_air_bagcart_FlatNosed</b></td>
  </tr>
  <tr>
    <td>Boats</td>
    <td><b> title=cargoA<br>
 title=cargoA_hoop<br>
 title=cargoB</b></td>
  </tr>
  <tr>
    <td>Miscellaneous</td>
    <td><p><B>title=Flour_bomb_floating_dock</B> </p>
    <p><B>title=CaspianSeaMonster</B></p>
    <p><B>title=HumpbackWhale</B><BR>
    </p></td>
  </tr>
</table>
<p>&nbsp;</p>
<p><BR>
  <I>InitPos</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the initaial position, using a <b><a href="#SIMCONNECT_DATA_INITPOSITION">SIMCONNECT_DATA_INITPOSITION</a></b> structure.<BR>
<I>RequestID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined request ID.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><a href="#AIObjectsandWaypoints">AI Objects and Waypoints </a></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>This function can be used to create a stationary aircraft (such as an unflyable aircraft on display outside a flight museaum), 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 <b><a href="#SIMCONNECT_EXCEPTION">SIMCONNECT_EXCEPTION</a></b> enum for more details). </p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SimConnect_AICreateEnrouteATCAircraft"><B>SimConnect_AICreateEnrouteATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateNonATCAircraft"><B>SimConnect_AICreateNonATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateParkedATCAircraft"><B>SimConnect_AICreateParkedATCAircraft</B></A></li>
<li><A HREF="#SimConnect_AIRemoveObject"><B>SimConnect_AIRemoveObject</B></A></li>
<li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<hr>
<A NAME="SimConnect_AIReleaseControl"></A>
<H3>SimConnect_AIReleaseControl</H3>
<p>The <B>SimConnect_AIReleaseControl</B> 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.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_AIReleaseControl(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_OBJECT_ID</B>&nbsp;&nbsp;<I>ObjectID</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><BR>
<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object. <BR>
  <I>ObjectID</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the server defined object ID. <BR>
  <I>RequestID</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined request ID.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR>
<table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5>
  <tr>
    <td><H5>Return value</H5></td>
    <td><H5>Description</H5></td>
  </tr>
  <tr>
    <td><p>S_OK</p></td>
    <td><p>The function succeeded. </p></td>
  </tr>
  <tr>
    <td><p>E_FAIL</p></td>
    <td><p>The function failed. </p></td>
  </tr>
</table>

<H4>Remarks</H4>
<p>This 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. </p>
<p>&nbsp;</p>
<p>The object ID can be obtained in a number of ways, refer to the <a href="#SimConnect_RequestDataOnSimObjectType"><b>SimConnect_RequestDataOnSimObjectType</b></a> call, and also the use of the <a href="#SIMCONNECT_RECV_ASSIGNED_OBJECT_ID"><b>SIMCONNECT_RECV_ASSIGNED_OBJECT_ID</b></a> structure. </p>
<H4>See Also</H4>
<UL type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
  <LI><A HREF="#SimConnect_AICreateEnrouteATCAircraft"><B>SimConnect_AICreateEnrouteATCAircraft</B></A></li>
  <LI><A HREF="#SimConnect_AICreateNonATCAircraft"><B>SimConnect_AICreateNonATCAircraft</B></A></li>
  <LI><A HREF="#SimConnect_AICreateParkedATCAircraft"><B>SimConnect_AICreateParkedATCAircraft</B></A></li>
  <LI><A HREF="#SimConnect_AICreateSimulatedObject"><B>SimConnect_AICreateSimulatedObject</B></A></li>
  <li><A HREF="#SimConnect_AISetAircraftFlightPlan"><B>SimConnect_AISetAircraftFlightPlan</B></A></li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_AIRemoveObject"></A><H3>SimConnect_AIRemoveObject</H3>
<p>The <B>SimConnect_AIRemoveObject</B> function is used to remove any object created by the client using one of the  AI creation functions.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_AIRemoveObject(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_OBJECT_ID</B>&nbsp;&nbsp;<I>ObjectID</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>ObjectID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the server defined object ID (refer to the <a href="#SIMCONNECT_RECV_ASSIGNED_OBJECT_ID"><b>SIMCONNECT_RECV_ASSIGNED_OBJECT_ID</b></a> structure).  <BR>
<I>RequestID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined request ID.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>A client application can only remove AI controlled objects that it created, not objects created by other clients, or <i>Flight Simulator</i> itself.</p>
<H4>See Also</H4>
<UL type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
  <LI><A HREF="#SimConnect_AICreateEnrouteATCAircraft"><B>SimConnect_AICreateEnrouteATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateNonATCAircraft"><B>SimConnect_AICreateNonATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateParkedATCAircraft"><B>SimConnect_AICreateParkedATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateSimulatedObject"><B>SimConnect_AICreateSimulatedObject</B></A></li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_AISetAircraftFlightPlan"></A><H3>SimConnect_AISetAircraftFlightPlan</H3>
<p>The <B>SimConnect_AISetAircraftFlightPlan</B> function is used to set or change the flight plan of an AI controlled aircraft.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_AISetAircraftFlightPlan(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_OBJECT_ID</B>&nbsp;&nbsp;<I>ObjectID</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szFlightPlanPath</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>ObjectID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the server defined object ID.
<BR>
<I>szFlightPlanPath</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the path to the flight plan file. Flight plans have the extension .pln, but no need to enter an extension here. The easiest way to create flight plans is to create them from within <i>Flight Simulator</i> itself, and then save them off for use with the AI controlled aircraft. There is no need to enter the full path (just the filename) if the flight plan is in the default <i>Flight Simulator X Files</i> directory. See the section on <a href="#AircraftFlightPlans">Aircraft Flight Plans</a>.<BR>
<I>RequestID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies client defined request ID.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#AITraffic">AI Traffic </a></p></td>
  </tr>
</table>
<H4>Remarks</H4>
<p> A number of errors, including <b>SIMCONNECT_EXCEPTION_CREATE_FLIGHTPLAN_FAILED</b>, apply to AI objects (refer to the <b><a href="#SIMCONNECT_EXCEPTION">SIMCONNECT_EXCEPTION</a></b> enum for more details).</p>
<p>&nbsp;</p>
<p>Typically this function would be used some time after the aircraft was created using the <A HREF="#SimConnect_AICreateParkedATCAircraft"><B>SimConnect_AICreateParkedATCAircraft</B></A> call.</p>
<H4>See Also</H4>
<UL type="disc">
<li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>

<LI><A HREF="#SimConnect_AICreateEnrouteATCAircraft"><B>SimConnect_AICreateEnrouteATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateNonATCAircraft"><B>SimConnect_AICreateNonATCAircraft</B></A></li>
<LI><A HREF="#SimConnect_AICreateParkedATCAircraft"><B>SimConnect_AICreateParkedATCAircraft</B></A></li>
</UL>
<br><hr><br>

<h2>Camera Specific Functions</h2>
<A NAME="SimConnect_CameraSetRelative6DOF"></A></p>
<H3>SimConnect_CameraSetRelative6DOF</H3>
<p>The <B>SimConnect_CameraSetRelative6DOF</B> function is used to adjust the user's aircraft view camera.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_CameraSetRelative6DOF(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>fDeltaX</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>fDeltaY</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>fDeltaZ</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>fPitchDeg</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>fBankDeg</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>fHeadingDeg</I><BR>
<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object. <BR>
  <I>fDeltaX</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Float containing the delta in the x-axis from the eyepoint reference point.
  See the <i>[views] </i>section of the <a href="../../SimObject Creation Kit/SimObject Container SDK/Aircraft Configuration Files.htm">Aircraft Configuration Files</a> document for a description of the eyepoint. <BR>
  <I>fDeltaY</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Float containing the delta in the y-axis from the eyepoint reference point. <BR>
  <I>fDeltaZ</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Float containing the delta in the z-axis from the eyepoint reference point. <BR>
  <I>fPitchDeg</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Float containing the pitch in degrees (rotation about the x axis).
  A postive value  points the nose down, a negative value up. The range of allowable values is +90 to -90 degrees.<BR>
  <I>fBankDeg</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Float  containing the bank angle in degrees (rotation about the z axis).
  The range of allowable values is +180 to -180 degrees.<BR>
  <I>fHeadingDeg</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Float containing the heading in degrees (rotation about the y axis). A positive value rotates the view right, a negative value left. If the user is viewing the 2D cockpit, the view will change to the Virtual Cockpit 3D view if the angle exceeds 45 degrees from the view ahead. The Virtual Cockpit view will change back to the 2D cockpit view if the heading angle drops below 45 degrees. The range of allowable values is +180 to -180 degrees.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR>
<table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5>
  <tr>
    <td><H5>Return value</H5></td>
    <td><H5>Description</H5></td>
  </tr>
  <tr>
    <td><p>S_OK</p></td>
    <td><p>The function succeeded. </p></td>
  </tr>
  <tr>
    <td><p>E_FAIL</p></td>
    <td><p>The function failed. </p></td>
  </tr>
</table>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#CockpitCamera">Cockpit Camera</a></p></td>
  </tr>
</table>
<p>&nbsp;</p>
<H4>Remarks</H4>
<p>Any one of the six parameters can be set to <b>SIMCONNECT_CAMERA_IGNORE_FIELD</b> which indicates that the value for the camera should be taken unmodified from the reference point.</p>
<H4>See Also</H4>
<UL type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<hr>
<h2>Menu Specific Functions<a name="MenuSpecificFunctions"></a><BR>
  <A NAME="SimConnect_MenuAddItem"></A> </h2>
<H3>SimConnect_MenuAddItem</H3>
<p>The <B>SimConnect_MenuAddItem</B> function is used to add a menu item, associated with a client event.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_MenuAddItem(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szMenuItem</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_EVENT_ID</B>&nbsp;&nbsp;<I>MenuEventID</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwData</I><BR>
<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object. <BR>
  <I>szMenuItem</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the text for the menu item. <BR>
  <I>MenuEventID</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined event ID, that is to be transmitted when the menu item is selected (in the <i>uEventID</i> parameter of the <b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b> sturcture).<BR>
  <I>dwData</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing a data value that the client can specifiy for its own use (it will be returned in the <i>dwData</i> parameter of the <b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b> structure.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR>
<table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5>
  <tr>
    <td><H5>Return value</H5></td>
    <td><H5>Description</H5></td>
  </tr>
  <tr>
    <td><p>S_OK</p></td>
    <td><p>The function succeeded. </p></td>
  </tr>
  <tr>
    <td><p>E_FAIL</p></td>
    <td><p>The function failed. </p></td>
  </tr>
</table>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#MenuItems">Menu Items </a></p></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>The menu item will be added to the <i>Add-ons</i> menu. The <i>Add-ons</i> menu will only appear in <i>Flight Simulator</i> if there is at least one menu entry. Sub-menu items can be associated with this menu item, see <A HREF="#SimConnect_MenuAddSubItem"><B>SimConnect_MenuAddSubItem</B></A>. 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 <b><a href="#SimConnect_MenuDeleteItem">SimConnect_MenuDeleteItem</a></b>).</p>
<p>&nbsp;</p>
<p>Each client can add a number of main menu items.</p>
<H4>See Also</H4>
<UL type="disc">
  <li><A HREF="#SimConnect_MenuDeleteItem"><B>SimConnect_MenuDeleteItem</B></A></li>
  <li><A HREF="#SimConnect_MenuDeleteSubItem"><B>SimConnect_MenuDeleteSubItem</B></A></li>
  <LI><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a></li>
</UL>
<BR>
<HR>
<BR>
<A NAME="SimConnect_MenuAddSubItem">
<H3>SimConnect_MenuAddSubItem</H3>
</A>
<p>The <B>SimConnect_MenuAddSubItem</B> function is used to add a sub-menu item, associated with a client event.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_MenuAddSubItem(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_EVENT_ID</B>&nbsp;&nbsp;<I>MenuEventID</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szMenuItem</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_EVENT_ID</B>&nbsp;&nbsp;<I>SubMenuEventID</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwData</I><BR>
<B>);</B></CODE><BR>
<CODE><BR>
</CODE>
<H4>Parameters</H4>
<I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object. <BR>
<I>EventID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined menu event ID. This is the ID of the menu item that this item should be added to.. <BR>
<I>szMenuItem</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the text for the sub-menu item. <BR>
<I>EventID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined sub-menu event ID, that is to be transmitted when the sub-menu item is selected (in the <i>uEventID</i> parameter of the <b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b> sturcture). This ID must be unique across all sub-menu items for the client. <BR>
<I>dwData</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing a data value that the client can specifiy for its own use (it will be returned in the <i>dwData</i> parameter of the <b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b> structure.<BR>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR>
<table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5>
  <tr>
    <td><H5>Return value</H5></td>
    <td><H5>Description</H5></td>
  </tr>
  <tr>
    <td><p>S_OK</p></td>
    <td><p>The function succeeded. </p></td>
  </tr>
  <tr>
    <td><p>E_FAIL</p></td>
    <td><p>The function failed. </p></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>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, <b>SIMCONNECT_EXCEPTION_TOO_MANY_OBJECTS</b>, will be returned if an attempt is made to add more than 16 sub-menu items. </p>
<H4>See Also</H4>
<ul>
  <li><A HREF="#SimConnect_MenuAddItem"><B>SimConnect_MenuAddItem</B></A></li>
  <li><A HREF="#SimConnect_MenuDeleteItem"><B>SimConnect_MenuDeleteItem</B></A></li>
  <li><A HREF="#SimConnect_MenuDeleteSubItem"><B>SimConnect_MenuDeleteSubItem</B></A></li>
  <LI><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a></li>
</ul>
<br>
<hr>
<br>
<A NAME="SimConnect_MenuDeleteItem"></A>
<H3>SimConnect_MenuDeleteItem</H3>
<p>The <B>SimConnect_MenuDeleteItem</B> function is used to remove a client defined menu item.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_MenuDeleteItem(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const SIMCONNECT_CLIENT_EVENT_ID</B>&nbsp;&nbsp;<I>MenuEventID</I><BR>
<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object. <BR>
  <I>MenuEventID</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined event ID.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR>
<table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5>
  <tr>
    <td><H5>Return value</H5></td>
    <td><H5>Description</H5></td>
  </tr>
  <tr>
    <td><p>S_OK</p></td>
    <td><p>The function succeeded. </p></td>
  </tr>
  <tr>
    <td><p>E_FAIL</p></td>
    <td><p>The function failed. </p></td>
  </tr>
</table>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#MenuItems">Menu Items </a></p></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>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 <b><a href="#SimConnect_MenuAddItem">SimConnect_MenuAddItem</a></b>.</p>
<H4>See Also</H4>
<UL type="disc">
  <li><A HREF="#SimConnect_MenuDeleteSubItem"><B>SimConnect_MenuDeleteSubItem</B></A><A HREF="#SimConnect_MenuAddSubItem"></A></li>
  <LI><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a></li>
</UL>
<BR>
<HR>
<BR>
<A NAME="SimConnect_MenuDeleteSubItem">
<H3>SimConnect_MenuDeleteSubItem</H3>
</A>
<p>The <B>SimConnect_MenuDeleteSubItem</B> function is used to remove a specifed sub-menu item.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_MenuDeleteSubItem(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_CLIENT_EVENT_ID</B>&nbsp;&nbsp;<I>MenuEventID</I><BR>
&nbsp;&nbsp;<B>const SIMCONNECT_CLIENT_EVENT_ID </B>&nbsp;&nbsp;<I>SubMenuEventID</I><BR>
<B>);</B></CODE><BR>
<CODE><BR>
</CODE>
<H4>Parameters</H4>
<I>hSimConnect</I><BR>
&nbsp;&nbsp;[in] Handle to a SimConnect object.<BR>
<I>MenuEventID</I><BR>
&nbsp;&nbsp;&nbsp;[in] Specifies the client defined menu event ID, from which the sub-menu item is to be removed. <BR>
<I>SubMenuEventID</I><BR>
&nbsp;&nbsp;&nbsp;[in] Specifies the client defined sub-menu event ID.<BR>
<H4>Return Values</H4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<H4>Remarks</H4>
<p>If a sub-menu item is deleted from the middle of the sub-menu item list, the list will contract.</p>
<H4>See Also</H4>
<ul>
  <li><A HREF="#SimConnect_MenuAddItem"><B>SimConnect_MenuAddItem</B></A></li>
  <li><A HREF="#SimConnect_MenuAddSubItem"><B>SimConnect_MenuAddSubItem</B></A></li>
  <li><A HREF="#SimConnect_MenuDeleteItem"><B>SimConnect_MenuDeleteItem</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a></li>
</ul>
<BR><hr>
<h2>Mission Specific Functions<a name="MissionSpecificFunctions"></a><BR>
  <A NAME="SimConnect_CompleteCustomMissionAction"></A></h2>
<H3>SimConnect_CompleteCustomMissionAction</H3>
<p>The <B>SimConnect_CompleteCustomMissionAction</B> function is used to complete the mission action specified by a GUID.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_CompleteCustomMissionAction(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const GUID</B>&nbsp;&nbsp;<I>guidInstanceId</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR><I>guidInstanceId</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;GUID of the custom action. The GUID should be found in the associated mission xml file.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>
<h4>Working Sample</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><a href="#MissionAction">Mission Action </a></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>A mission is specified in an xml file (see the <a href="../../Mission Creation Kit/Mission Creation.html">Mission Creation</a> documentation). A custom action is defined within this xml file, and will look similar to the following:</p>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><p>&lt;SimMission.CustomAction InstanceId=&quot;{<i> GUID </i>}&quot;&gt;<br>
  </p>
      <p>&lt;PayLoadString&gt;<i>Any string goes here!</i>&lt;/PayLoadString&gt;<br>
  </p>
      <p>&lt;WaitForCompletion&gt;True&lt;/WaitForCompletion&gt;<br>
  </p>
    <p>&lt;/SimMission.CustomAction&gt;</p></td>
  </tr>
</table>
<p>&nbsp;</p>
<p>Custom actions provide a mechanism to add complex processing to the basically data-driven mission system within <i>Flight Simulator</i>.</p>
<p>&nbsp;</p>
<p>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 <b><a href="#SimConnect_ExecuteMissionAction">SimConnect_ExecuteMissionAction</a></b>. It is only necessary to call <B>SimConnect_CompleteCustomMissionAction</B> if the <b>WaitForCompletion</b> value is set to <b>True</b>.</p>
<p>&nbsp;</p>
<p>If the client calls <b><a href="#SimConnect_ExecuteMissionAction">SimConnect_ExecuteMissionAction</a></b> from within the code for a custom action, and it is important that this action completes before any other actions are started (that is, <b>WaifForCompletion</b> is <b>True</b>) then a second custom action should be defined that calls <B>SimConnect_CompleteCustomMissionAction</B> after that action is complete, and with the GUID of the first custom action as its parameter. The working sample shows this process. </p>
<p>&nbsp;</p>
<p>In order to received notifications that a custom action is to be executed, the SimConnect client  should use the <a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a> call with the <i>SystemEventName</i> parameter set to <b>&quot;CustomMissionActionExecuted&quot;</b>. This will result in the GUID of the custom action, and the <b>PayLoadString</b>, being sent to the client in a <A HREF="#SIMCONNECT_RECV_CUSTOM_ACTION"><B>SIMCONNECT_RECV_CUSTOM_ACTION</B></A> structure. </p>
<p>&nbsp;</p>
<p>If a mission requires additional processing on its completion the SimConnect client  should use the <a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a> call with the <i>SystemEventName</i> parameter set to <b>&quot;MissionCompleted&quot;</b>.</p>
<H4>See Also</H4>
<UL type="disc">
<li><A HREF="#SimConnect_ExecuteMissionAction"><B>SimConnect_ExecuteMissionAction</B></A></li>
  <li><a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_ExecuteMissionAction"></A><H3>SimConnect_ExecuteMissionAction</H3>
<p>The <B>SimConnect_ExecuteMissionAction</B> function is used to execute the mission action specified by a GUID.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_ExecuteMissionAction(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const GUID</B>&nbsp;&nbsp;<I>guidInstanceId</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR><I>guidInstanceId</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;GUID of the Mission Action. The GUID should be found in the associated mission xml file.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><a href="#MissionAction">Mission Action </a></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>A mission is specified in an xml file (see the <a href="../../Mission Creation Kit/Mission Creation.html">Mission Creation</a> documentation).</p>
<p>&nbsp;</p>
<p>In order to use <B>SimConnect_ExecuteMissionAction</B>, 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 <B>SimConnect_ExecuteMissionAction</B>, one or more actions (spoken text, for example) that are defined within the xml file. </p>
<p>&nbsp;</p>
<p>See the remarks for<A HREF="#SimConnect_CompleteCustomMissionAction"><B> SimConnect_CompleteCustomMissionAction</B></A>.</p>
<H4>See Also</H4>
<UL type="disc">
<li><A HREF="#SimConnect_CompleteCustomMissionAction"><B>SimConnect_CompleteCustomMissionAction</B></A></li>
  <li><A HREF="#SIMCONNECT_RECV_CUSTOM_ACTION"><B>SIMCONNECT_RECV_CUSTOM_ACTION</B></A></li>
  <li><a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<BR><HR>
<h2>Weather Specifc Functions<a name="WeatherSpecifcFunctions"></a></h2>
<BR>
<A NAME="SimConnect_WeatherCreateStation"></A>
<H3>SimConnect_WeatherCreateStation</H3>
<p>The <B>SimConnect_WeatherCreateStation</B> function creates a weather station at the given ICAO location.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_WeatherCreateStation(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><b>,</b><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><b>,</b><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szICAO</I><b>,</b><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szName</I><b>,</b><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>lat</I><b>,</b><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>lon</I><b>,</b><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>alt</I><BR>

<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.</p>
<I>RequestID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined request ID.
<BR>
<I>szICAO</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ICAO string.
This can be an existing airport ICAO string, as long as the airport does not already have a weather station, or it can be a unique new ICAO code to be used just for the purposes of this weather station. <BR>
<I>szName</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies  a descriptive name for the new weather station. This name will appear on the weather map in the weather dialogs of <i>Flight Simulator</i>. <BR>
<I>lat</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the latitude of the station in degrees.
The latitude, longitude and altitude parameters should be set to 0 if the ICAO code supplied is from an existing airport. <BR>
<I>lon</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the longitude of the station in degrees.
<BR>
<I>alt</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the altitude of the station in feet, above ground level.
  
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR>
<table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5>
  <tr>
    <td><H5>Return value</H5></td>
    <td><H5>Description</H5></td>
  </tr>
  <tr>
    <td><p>S_OK</p></td>
    <td><p>The function succeeded. </p></td>
  </tr>
  <tr>
    <td><p>E_FAIL</p></td>
    <td><p>The function failed. </p></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>If an attempt is made to create a weather station at an airport that already has one, the error <B>SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_CREATE_STATION</B> will be returned.</p>
<p>&nbsp;</p>
<p>Once a weather station has been successfully created, its weather output can be set with a call to <A HREF="#SimConnect_WeatherSetObservation"><B>SimConnect_WeatherSetObservation</B></A>, and retrieved with a call to <a href="#SimConnect_WeatherRequestObservationAtStation"><b>SimConnect_WeatherRequestObservationAtStation</b></a>.</p>
<H4>See Also</H4>
<UL type="disc">
  <LI><A HREF="#SimConnect_WeatherRemoveStation"><B>SimConnect_WeatherRemoveStation</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>

<hr>
<h2><A NAME="SimConnect_WeatherCreateThermal"></A></h2>
<H3>SimConnect_WeatherCreateThermal</H3>
<p>The <B>SimConnect_WeatherCreateThermal</B> function is used to create a thermal at a specific location.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_WeatherCreateThermal(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>lat</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>lon</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>alt</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>radius</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>height</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>coreRate = 3.0f</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>coreTurbulence = 0.05f</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>sinkRate = 3.0f</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>sinkTurbulence = 0.2f</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>coreSize = 0.4f</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>coreTransitionSize = 0.1f</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>sinkLayerSize = 0.4f</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>sinkTransitionSize = 0.1f</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>RequestID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined request ID.
<BR>
<I>lat</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the latitude of the thermal in degrees.
<BR>
<I>lon</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the longitude of the thermal in degrees.
<BR>
<I>alt</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the altitude of the thermal in feet, above ground level.
<BR>
<I>radius</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the radius of the thermal, in meters. The maximum radius of a thermal is 100Km.<BR>
<I>height</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the height of the thermal, in meters. 

<BR>
<I>coreRate</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies the lift value, in meters per second, within the Core layer. A positive value will provide an updraft, a negative value a downdraft. The maximum rate is 1000 meters/second. Refer to the diagram in the Remarks section.
<BR>
<I>coreTurbulence</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies a variation in meters per second that is applied to the <i>coreRate</i>. For example, if a value of 1.5 is entered, and the core rate is 5 m/s, the actual core rate applied will be randomly varying between 3.5 m/s and 6.5 m/s.
<BR>
<I>sinkRate</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies the lift value, in meters per second, within the Sink layer. A positive value will provide an updraft, a negative value a downdraft. The maximum rate is 1000 meters/second. Refer to the diagram in the Remarks section.
<BR>
<I>coreTurbulence</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies a variation in meters per second that is applied to the <i>sinkRate</i>. For example, if a value of 1.5 is entered, and the sink rate is 5 m/s, the actual sink rate applied will be randomly varying between 3.5 m/s and 6.5 m/s.
<BR>
<I>coreSize</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies the radius in meters of the Core of the thermal. 
<BR>
<I>coreTransitionSize</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies the width in meters of the transition layer between the Core and the Sink of the thermal. Half of the width of this transition will be outside the Core, and half within. 
<BR>
<I>sinkSize</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies the radius in meters of the Sink of the thermal. 
<BR>
<I>sinkTransitionSize</I><BR>
&nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Specifies the width in meters of the transition layer between the Sink and the atmosphere outside of the thermal. Half of the width of this transition will be outside the radius of the Sink layer, and half within.</p>

<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>There is no limit to the number of thermals that can be created. Within the simulator a thermal is defined as a cylinder with a Core layer and a Sink layer:</p>
<p>&nbsp; </p>
<table class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><img src="../../Mission Creation Kit/Mission Art/Thermal.JPG" width="385" height="355"></td>
  </tr>
</table>
<p>&nbsp;</p>
<p>Refer also to the <a href="../../Environment Kit/Weather SDK/Weather.html">Weather Systems</a> documentation. </p>
<H4>See Also</H4>
<UL type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a> </li>
<LI><A HREF="#SimConnect_WeatherRemoveThermal"><B>SimConnect_WeatherRemoveThermal</B></A></li>
<LI><A HREF="#SimConnect_WeatherRequestInterpolatedObservation"><B>SimConnect_WeatherRequestInterpolatedObservation</B></A></li>
<LI><A HREF="#SimConnect_WeatherRequestObservationAtStation"><B>SimConnect_WeatherRequestObservationAtStation</B></A></li>
<LI><A HREF="#SimConnect_WeatherRequestObservationAtNearestStation"><B>SimConnect_WeatherRequestObservationAtNearestStation</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetObservation"><B>SimConnect_WeatherSetObservation</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeServer"><B>SimConnect_WeatherSetModeServer</B></A></li>
</UL>
<hr>
<A NAME="SimConnect_WeatherRemoveStation"></A>
<H3>SimConnect_WeatherRemoveStation</H3>
<p>The <B>SimConnect_WeatherRemoveStation</B> function requests that the weather station identified by the given ICAO string is removed.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_WeatherRemoveStation(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><b>,</b><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><b>,</b><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szICAO</I><BR>
<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.</p>
<I>RequestID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client defined request ID.
<BR>
<I>szICAO</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ICAO string of the station to remove. The station must be one that was created by the same SimConnect client.<BR>

<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR>
<table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5>
  <tr>
    <td><H5>Return value</H5></td>
    <td><H5>Description</H5></td>
  </tr>
  <tr>
    <td><p>S_OK</p></td>
    <td><p>The function succeeded. </p></td>
  </tr>
  <tr>
    <td><p>E_FAIL</p></td>
    <td><p>The function failed. </p></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>If a call is made to remove a weather station created by another client, or an exiting one within <i>Flight Simulator</i>, the error <B>SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_REMOVE_STATION</B> will be returned. </p>
<p>&nbsp;</p>
<p>If the client is closed, then all weather stations created by the client will be removed. </p>
<H4>See Also</H4>
<UL type="disc">
  <LI><A HREF="#SimConnect_WeatherCreateStation"><B>SimConnect_WeatherCreateStation</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>

<BR><HR><BR>
<A NAME="SimConnect_WeatherRemoveThermal"></A><H3>SimConnect_WeatherRemoveThermal</H3>
<p>The <B>SimConnect_WeatherRemoveThermal</B> function removes a thermal.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_WeatherRemoveThermal(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_OBJECT_ID</B>&nbsp;&nbsp;<I>ObjectID</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR>
<I>ObjectID</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the object ID of the thermal to be removed.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>A client application can only remove thermals that it created, and not thermals created by other clients or by <i>Flight Simulator</i>. If the client is closed, then all thermals created by the client will be removed. </p>
<H4>See Also</H4>
<UL type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a> </li>
<LI><A HREF="#SimConnect_WeatherCreateThermal"><B>SimConnect_WeatherCreateThermal</B></A></li>
<LI><A HREF="#SimConnect_WeatherRequestInterpolatedObservation"><B>SimConnect_WeatherRequestInterpolatedObservation</B></A></li>
<LI><A HREF="#SimConnect_WeatherRequestObservationAtStation"><B>SimConnect_WeatherRequestObservationAtStation</B></A></li>
<LI><A HREF="#SimConnect_WeatherRequestObservationAtNearestStation"><B>SimConnect_WeatherRequestObservationAtNearestStation</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetObservation"><B>SimConnect_WeatherSetObservation</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeServer"><B>SimConnect_WeatherSetModeServer</B></A></li>
</UL>
<HR>
<BR>
<A NAME="SimConnect_WeatherRequestCloudState"></A>
<H3>SimConnect_WeatherRequestCloudState</H3>
<p>The <B>SimConnect_WeatherRequestCloudState</B> function requests cloud density information on a given area. </p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_WeatherRequestCloudState(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_DATA_REQUEST_ID</B>&nbsp;&nbsp;<I>RequestID</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>minLat</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>minLon</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>minAlt</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>maxLat</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>maxLon</I><B>,</B><BR>
&nbsp;&nbsp;<B>float</B>&nbsp;&nbsp;<I>maxAlt</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwFlags = 0</I><BR>
<B>);</B><BR>
<BR>
</CODE>
<H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object. <BR>
  <I>RequestID</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the client-defined request ID. <BR>
  <I>minLat</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the minimum latitude of the required area. This should simply be the lower of the two latitude numbers.<BR>
  <I>minLon</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the minimum longitude of the required area. This should simply be the lower of the two longitude numbers. <BR>
  <I>minAlt</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the minimum altitude of the required area, in feet. <BR>
  <I>maxLat</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the maximum latitude of the required area. <BR>
  <I>maxLon</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the maximum longitude of the required area. <BR>
  <I>maxAlt</I><BR>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the maximum altitude of the required area, in feet. <BR>
  <I>dwFlags</I><BR>
  &nbsp;&nbsp;[in, optional]&nbsp;&nbsp;Double word containing any flags. Reserved for future use.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR>
<table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5>
  <tr>
    <td><H5>Return value</H5></td>
    <td><H5>Description</H5></td>
  </tr>
  <tr>
    <td><p>S_OK</p></td>
    <td><p>The function succeeded. </p></td>
  </tr>
  <tr>
    <td><p>E_FAIL</p></td>
    <td><p>The function failed. </p></td>
  </tr>
</table>

<H4>Remarks</H4>
<p>The main purpose of this function is to enable weather radar.</p>
<p>&nbsp; </p>
<p>If the call is successful, the cloud state information will be returned in a <b><a href="#SIMCONNECT_RECV_CLOUD_STATE">SIMCONNECT_RECV_CLOUD_STATE</a></b> structure. This structure will contain a two dimensional array of byte data. 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 area defined in this call is divided into 64 by 64 cells, so the size of each cell will be determined by the values given for the parameters above. Note that the entire World's weather is not simulated all the time, but only a region around the user aircraf, with a radius of approximately 128 kilometers, is modeled at any one time. A request for cloud data outside this region will simply return zeros. </p>
<p>&nbsp;</p>
<p>The defined area can cross the Equator or the Greenwich Meridian, but it cannot cross the Poles or the International Date Line.</p>
<H4>See Also</H4>
<UL type="disc">
  <LI><A HREF="#SimConnect_WeatherSetDynamicUpdateRate"><B>SimConnect_WeatherSetDynamicUpdateRate</B></A></li>
  <LI><A HREF="#SimConnect_WeatherSetModeCustom"><B>SimConnect_WeatherSetModeCustom</B></A></li>
  <LI><A HREF="#SimConnect_WeatherSetModeGlobal"><B>SimConnect_WeatherSetModeGlobal</B></A></li>
  <LI><A HREF="#SimConnect_WeatherSetModeServer"><B>SimConnect_WeatherSetModeServer</B></A></li>
  <LI><A HREF="#SimConnect_WeatherSetModeTheme"><B>SimConnect_WeatherSetModeTheme</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<BR><HR><BR>


<a name="SimConnect_WeatherRequestInterpolatedObservation"></a>
<h3>SimConnect_WeatherRequestInterpolatedObservation</h3>

<p>The <b>SimConnect_WeatherRequestInterpolatedObservation</b>
function is used to send a request for weather data that is
interpolated from the weather at the nearest three weather stations.</p>

<h4>Syntax</h4>

<code><b>HRESULT
SimConnect_WeatherRequestInterpolatedObservation(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATA_REQUEST_ID</b>&nbsp;&nbsp;<i>RequestID</i><b>,</b><br>

&nbsp;&nbsp;<b>float</b>&nbsp;&nbsp;<i>lat</i><b>,</b><br>

&nbsp;&nbsp;<b>float</b>&nbsp;&nbsp;<i>lon</i><b>,</b><br>
&nbsp;&nbsp;<b>float</b>&nbsp;&nbsp;<i>alt</i><br>
<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.
<br>

<i>RequestID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client defined
request. This is used later by the client to identify which data has
been
received.
<br>

<i>lat</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies latitude in
degrees.<br>

<i>lon</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies longitude in
degrees.</p>

<i>alt</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies altitude in feet above sea level. This differs from most weather data  altitudes, which are feet above ground level.
<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>

<p><code>DWORD dwRequestID = 1000;<b><br>

hr = SimConnect_WeatherRequestInterpolatedObservation(hSimConnect,
dwRequestID, -80.0, 44.0, 10000);</b></code></p>

<h4>Remarks</h4>
<p>The weather data will be returned in a <a href="#SIMCONNECT_RECV_WEATHER_OBSERVATION"><b>SIMCONNECT_RECV_WEATHER_OBSERVATION</b></a> structure. A number of errors apply specifically to weather data, see the <a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a> enumeration. </p>
<p>&nbsp;</p>
<p>Interpolated weather data can be used to identify suitable locations for thermals and other local weather systems. The process of using the three nearest stations is not without its drawbacks, as all three stations could be in one direction of the specified point, and not a reasonable spread in different directions. Weather data is returned in <a href="#Metar_Data_Format">Metar data format</a>. </p>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_WeatherRequestObservationAtStation"><b>SimConnect_WeatherRequestObservationAtStation</b></a></li>

  <li><a href="#SimConnect_WeatherRequestObservationAtNearestStation"><b>SimConnect_WeatherRequestObservationAtNearestStation</b></a></li>

  <li><a href="#SimConnect_WeatherSetObservation"><b>SimConnect_WeatherSetObservation</b></a></li>

  <li><a href="#SimConnect_WeatherSetModeServer"><b>SimConnect_WeatherSetModeServer</b></a></li>

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a><br>

</li>
</ul>

<hr><br>

<a name="SimConnect_WeatherRequestObservationAtNearestStation"></a>
<h3>SimConnect_WeatherRequestObservationAtNearestStation</h3>

<p>The <b>SimConnect_WeatherRequestObservationAtNearestStation</b>
function is used to send a request for the weather data from the
weather station nearest to the specified lat/lon position.</p>

<h4>Syntax</h4>

<code><b>HRESULT
SimConnect_WeatherRequestObservationAtNearestStation(</b><br>

&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATA_REQUEST_ID</b>&nbsp;&nbsp;<i>RequestID</i><b>,</b><br>

&nbsp;&nbsp;<b>float</b>&nbsp;&nbsp;<i>lat</i><b>,</b><br>

&nbsp;&nbsp;<b>float</b>&nbsp;&nbsp;<i>lon</i><br>

<b>);</b><br>

<br>
</code>
<h4>Parameters</h4>

<p><i>hSimConnect</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
object.
<br>

<i>RequestID</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
client defined
request. This is used later by the client to identify which data has
been
received.
<br>

<i>lat</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies latitude in
degrees.<br>

<i>lon</i><br>

&nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies longitude in
degrees.</p>

<h4>Return Values</h4>

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

<br>

<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td>
      <h5>Return value</h5>      </td>

      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td>
      <p>S_OK</p>      </td>

      <td>
      <p>The function succeeded. </p>      </td>
    </tr>

    <tr>

      <td>
      <p>E_FAIL</p>      </td>

      <td>
      <p>The function failed. </p>      </td>
    </tr>
  </tbody>
</table>

<h4>Example</h4>

<p><code>DWORD dwRequestID = 1000;<b><br>

hr =
SimConnect_WeatherRequestObservationAtNearestStation(hSimConnect,
dwRequestID, -80.0, 44.0);</b></code></p>

<h4>Working Sample</h4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><a href="#WeatherStation">Weather Station </a></td>
  </tr>
</table>
<h4>Remarks</h4>
<p>The weather data will be returned in a <a href="#SIMCONNECT_RECV_WEATHER_OBSERVATION"><b>SIMCONNECT_RECV_WEATHER_OBSERVATION</b></a> structure. A number of errors apply specifically to weather data, see the <a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a> enumeration. Weather data is returned in <a href="#Metar_Data_Format">Metar data format</a>. </p>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_WeatherRequestInterpolatedObservation"><b>SimConnect_WeatherRequestInterpolatedObservation</b></a></li>

  <li><a href="#SimConnect_WeatherRequestObservationAtStation"><b>SimConnect_WeatherRequestObservationAtStation</b></a></li>

  <li><a href="#SimConnect_WeatherSetObservation"><b>SimConnect_WeatherSetObservation</b></a></li>

  <li><a href="#SimConnect_WeatherSetModeServer"><b>SimConnect_WeatherSetModeServer</b></a></li>

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a> </li>
</ul>

<hr>
<br>
<a name="SimConnect_WeatherRequestObservationAtStation"></a>
<h3>SimConnect_WeatherRequestObservationAtStation</h3>
<p>The <b>SimConnect_WeatherRequestObservationAtStation</b> function requests the weather data from a weather station identified by
  its ICAO code.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_WeatherRequestObservationAtStation(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>SIMCONNECT_DATA_REQUEST_ID</b>&nbsp;&nbsp;<i>RequestID</i><b>,</b><br>
&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>szICAO</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  <i>RequestID</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the ID of the
  client defined
  request. This is used later by the client to identify which data has
  been
  received. <br>
  <i>szICAO[4]</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string specifyin the ICAO
  identification code of the weather station. Typically this is an airport. Set to <b>GLOB</b> to retrieve global weather. </p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>
<h4>Example</h4>
<code>DWORD dwRequestID = 1000;<b><br>
hr = SimConnect_WeatherRequestObservationAtStation(hSimConnect,
dwRequestID, "ICAO");</b><br>
</code>
<h4>Working Sample</h4>
<p>See the working sample for zzz.</p>
<h4>Remarks</h4>
<p>The weather data will be returned in a <a href="#SIMCONNECT_RECV_WEATHER_OBSERVATION"><b>SIMCONNECT_RECV_WEATHER_OBSERVATION</b></a> structure. A number of errors apply specifically to weather data, see the <a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a> enumeration. Weather data is returned in <a href="#Metar_Data_Format">Metar data format</a>. </p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_WeatherRequestInterpolatedObservation"><b>SimConnect_WeatherRequestInterpolatedObservation</b></a></li>
  <li><a href="#SimConnect_WeatherRequestObservationAtNearestStation"><b>SimConnect_WeatherRequestObservationAtNearestStation</b></a></li>
  <li><a href="#SimConnect_WeatherSetObservation"><b>SimConnect_WeatherSetObservation</b></a></li>
  <li><a href="#SimConnect_WeatherSetModeServer"><b>SimConnect_WeatherSetModeServer</b></a></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a></li>
</ul>
<HR><BR>
<A NAME="SimConnect_WeatherSetDynamicUpdateRate"></A><H3>SimConnect_WeatherSetDynamicUpdateRate</H3>
<p>The <B>SimConnect_WeatherSetDynamicUpdateRate</B> function is used to set the rate at which cloud formations change.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_WeatherSetDynamicUpdateRate(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwRate</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR><I>dwRate</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing the rate. A value of zero indicates that cloud formations do not change at all. Values between 1 and 5 indicate that cloud formations should change from 1 (the slowest) to 5 (the fastest). These settings match those than can be set through the dialogs of <i>Flight Simulator X</i>.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>None.</p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SimConnect_WeatherRequestCloudState"><B>SimConnect_WeatherRequestCloudState</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeCustom"><B>SimConnect_WeatherSetModeCustom</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeGlobal"><B>SimConnect_WeatherSetModeGlobal</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeServer"><B>SimConnect_WeatherSetModeServer</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeTheme"><B>SimConnect_WeatherSetModeTheme</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_WeatherSetModeCustom"></A><H3>SimConnect_WeatherSetModeCustom</H3>
<p>The <B>SimConnect_WeatherSetModeCustom</B> function sets the weather mode to user-defined.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_WeatherSetModeCustom(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.</p><H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>Calling this function sets the weather mode to &quot;User-defined weather&quot; in  the Weather dialog of <i>Flight Simulator X</i>, so whatever the user has entered for the weather will be used. </p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SimConnect_WeatherRequestCloudState"><B>SimConnect_WeatherRequestCloudState</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetDynamicUpdateRate"><B>SimConnect_WeatherSetDynamicUpdateRate</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeGlobal"><B>SimConnect_WeatherSetModeGlobal</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeServer"><B>SimConnect_WeatherSetModeServer</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeTheme"><B>SimConnect_WeatherSetModeTheme</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_WeatherSetModeGlobal"></A><H3>SimConnect_WeatherSetModeGlobal</H3>
<p>The <B>SimConnect_WeatherSetModeGlobal</B> function sets the weather mode to global, so the same weather data is used everywhere.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_WeatherSetModeGlobal(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.</p><H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>


<H4>Remarks</H4>
<p>There is not an equivalent setting in the weather dialog of <i>Flight Simulator X</i>.</p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SimConnect_WeatherRequestCloudState"><B>SimConnect_WeatherRequestCloudState</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetDynamicUpdateRate"><B>SimConnect_WeatherSetDynamicUpdateRate</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeCustom"><B>SimConnect_WeatherSetModeCustom</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeServer"><B>SimConnect_WeatherSetModeServer</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeTheme"><B>SimConnect_WeatherSetModeTheme</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_WeatherSetModeServer"></A><H3>SimConnect_WeatherSetModeServer</H3>
<p>The <B>SimConnect_WeatherSetModeServer</B> function is used to switch to a local server for weather observation data.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_WeatherSetModeServer(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwPort</I><B>,</B><BR>
&nbsp;&nbsp;<B>DWORD</B>&nbsp;&nbsp;<I>dwSeconds</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR><I>dwPort</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing the port number of the weather server. Set this to zero to reset the weather to normal operation. <BR>
<I>dwSeconds</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Double word containing the amount of time, in seconds, that should elapse between each update. There is a minimum of 60 seconds.</p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>Calling this function sets the weather mode to &quot;Real-world weather &quot; in  the Weather dialog of <i>Flight Simulator X</i>. The Weather dialog only allows two update rates (none and 15 minutes), whereas this call gives much greater flexibility over the update rate. Setting the port number allows a local weather server to be used, rather than the default. </p>
<p>&nbsp;</p>
<p>A number of errors apply specifically to weather data, see the <a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a> enumeration.</p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SimConnect_WeatherRequestCloudState"><B>SimConnect_WeatherRequestCloudState</B></A></li>
<li><a href="#SimConnect_WeatherRequestInterpolatedObservation"><b>SimConnect_WeatherRequestInterpolatedObservation</b></a></li>
<li><a href="#SimConnect_WeatherRequestObservationAtStation"><b>SimConnect_WeatherRequestObservationAtStation</b></a></li>
<li><a href="#SimConnect_WeatherRequestObservationAtNearestStation"><b>SimConnect_WeatherRequestObservationAtNearestStation</b></a></li>
<li><a href="#SimConnect_WeatherSetObservation"><b>SimConnect_WeatherSetObservation</b></a></li>
<LI><A HREF="#SimConnect_WeatherSetDynamicUpdateRate"><B>SimConnect_WeatherSetDynamicUpdateRate</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeCustom"><B>SimConnect_WeatherSetModeCustom</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeGlobal"><B>SimConnect_WeatherSetModeGlobal</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeTheme"><B>SimConnect_WeatherSetModeTheme</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a> </li>
</UL>
<BR><HR><BR>
<A NAME="SimConnect_WeatherSetModeTheme"></A><H3>SimConnect_WeatherSetModeTheme</H3>
<p>The <B>SimConnect_WeatherSetModeTheme</B> function is used to set the weather to a particular theme.</p>
<H4>Syntax</H4>
<CODE><B>HRESULT SimConnect_WeatherSetModeTheme(</B><BR>
&nbsp;&nbsp;<B>HANDLE</B>&nbsp;&nbsp;<I>hSimConnect</I><B>,</B><BR>
&nbsp;&nbsp;<B>const char*</B>&nbsp;&nbsp;<I>szThemeName</I><BR>
<B>);</B><BR>
<BR>
</CODE><H4>Parameters</H4>
<p><I>hSimConnect</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect object.
<BR><I>szThemeName</I><BR>
&nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the theme filename. The corresponding files should exist in the <i>Microsoft Flight Simulator X/weather/themes</i> folder. For example, enter &quot;grayrain&quot; to set the same theme as if the user had selected <i>Gray and Rainy</i> from the Weather dialog. </p>
<H4>Return Values</H4>
<p>The function returns an <B>HRESULT</B>. Possible values include, but are not limited to, those in the following table.</p>
<BR><table cellSpacing=2 cellPadding=2 width=670 bordercolor="#dddddd" border=5><tr><td><H5>Return value</H5></td><td><H5>Description</H5></td></tr>
<tr><td><p>S_OK</p></td><td><p>The function succeeded.
</p></td></tr>
<tr><td><p>E_FAIL</p></td><td><p>The function failed.
</p></td></tr>
</table>

<H4>Remarks</H4>
<p>Calling this function sets the weather mode to &quot;Weather themes &quot; in  the weather dialog of <i>Flight Simulator X</i>.</p>
<p>&nbsp;</p>
<p>There are three files associated with a weather theme in <i>Flight Simulator X</i>, for example: grayrain.wt, grayrain.bmp and grayrain.wtb. The wt file contains the description that will appear in the Current Conditions box in the Weather dialog, the bmp file contains the image that will also appear in the weather dialog, and the wtb file contains data in a propriety format that contains the weather information. </p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SimConnect_WeatherRequestCloudState"><B>SimConnect_WeatherRequestCloudState</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetDynamicUpdateRate"><B>SimConnect_WeatherSetDynamicUpdateRate</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeCustom"><B>SimConnect_WeatherSetModeCustom</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeGlobal"><B>SimConnect_WeatherSetModeGlobal</B></A></li>
<LI><A HREF="#SimConnect_WeatherSetModeServer"><B>SimConnect_WeatherSetModeServer</B></A></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference </b></a></li>
</UL>

<hr>
<br>
<a name="SimConnect_WeatherSetObservation"></a>
<h3>SimConnect_WeatherSetObservation</h3>
<p>The <b>SimConnect_WeatherSetObservation</b> function is used to set the weather at a specific weather station, identified from within the Metar data string.</p>
<h4>Syntax</h4>
<code><b>HRESULT SimConnect_WeatherSetObservation(</b><br>
&nbsp;&nbsp;<b>HANDLE</b>&nbsp;&nbsp;<i>hSimConnect</i><b>,</b><br>
&nbsp;&nbsp;<b>DWORD</b>&nbsp;&nbsp;<i>Seconds</i><b>,</b><br>
&nbsp;&nbsp;<b>const char*</b>&nbsp;&nbsp;<i>szMETAR</i><br>
<b>);</b><br>
<br>
</code>
<h4>Parameters</h4>
<p><i>hSimConnect</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Handle to a SimConnect
  object. <br>
  
  <i>Seconds</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Specifies the time in seconds that the current weather should merge into the new weather.</p>
  <i>pszMETAR</i><br>
  &nbsp;&nbsp;[in]&nbsp;&nbsp;Null-terminated string containing the METAR data.</p>
<h4>Return Values</h4>
<p>The function returns an <b>HRESULT</b>. Possible
  values include, but are not limited to, those in the following table.</p>
<br>
<table border="5" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">
  <tbody>
    <tr>
      <td><h5>Return value</h5></td>
      <td><h5>Description</h5></td>
    </tr>
    <tr>
      <td><p>S_OK</p></td>
      <td><p>The function succeeded. </p></td>
    </tr>
    <tr>
      <td><p>E_FAIL</p></td>
      <td><p>The function failed. </p></td>
    </tr>
  </tbody>
</table>

<h4>Remarks</h4>
<p> A number of errors apply specifically to weather data, see the <a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a> enumeration.</p>
<p>&nbsp;</p>
<h6>Metar Data Format<a name="Metar_Data_Format"></a></h6>
<p>The data format used in <i>Flight Simulator</i> for setting and retrieving weather is a modification to the Metar standard. The standard format is open and is described on a number of websites. The Metar data used in <i>Flight Simulator </i>follows the following format. Note that each section is separated by a space, and that spaces cannot occur within a section (with one exception noted in the table). The sections must be in the correct order, though many are optional and need not be present. </p>
<p>&nbsp;</p>
<table class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Section </h5></td>
    <td><h5>Format</h5></td>
    <td><h5>Mulitple Entries </h5></td>
  </tr>
  <tr>
    <td><p>STATION ID</p>
    <p>(has an extension) </p></td>
    <td><p>CCCC - a three or four character station ID. For example <b>KORD</b> for O'Hare airport in Chicago. The string <b>GLOB</b> can be used to set global weather data.</p>
      <p>&nbsp;</p>
      <p><i>Flight Simulator</i> extension:<br>
      <br>
Format is <b>&amp;A</b>NNN</p>
    <p>&nbsp;</p>
    <p>This gives the height of the weather station in meters. This information is returned with a get observation, but when setting this extension must not be present. </p></td>
    <td>No</td>
  </tr>
  <tr>
    <td>REPORT TYPE</td>
    <td>Either <b>METAR</b> or <b>SPECI</b> keywords.</td>
    <td>No</td>
  </tr>
  <tr>
    <td>AUTO</td>
    <td>Optional <b>AUTO</b> keyword, for a fully automated report.</td>
    <td>No</td>
  </tr>
  <tr>
    <td>COR</td>
    <td>Optional <b>COR</b> keyword, for a corrected report.</td>
    <td>No</td>
  </tr>
  <tr>
    <td>DATETIME</td>
    <td><p>One of the following four formats (the exact number of characters must be present): </p>
        <p>HHMM<br>
          DDHHMM<br>
          HHMM<b>Z</b><br>
          DDHHMM<b>Z</b></p>
      <p>(all are UTC whether or not the Z is present).</p>
      <p>&nbsp;</p>
      <p>Note that this parameter is ignored when setting weather data. When getting the data, if it was set originally by the user through a SimConnect client or the Weather dialog then the time that it was set to will be returned. If the data was retrieved from a weather server, then the time stamp given to it by the server will be returned. </p></td>
    <td>No</td>
  </tr>
  <tr>
    <td>NIL</td>
    <td>Optional <b>NIL</b> keyword, indicating that no weather report could be made. </td>
    <td>No</td>
  </tr>
  <tr>
    <td>SURFACE WINDS (has an extension)</td>
    <td><p>One of the following two formats: </p>
        <p>DDDSSSUUU (steady)<br>
          DDDSSS<b>G</b>XXUUU (gusts)<br>
        </p>
      <p>where:<br>
        DDD = Direction (0-360 degrees, or <b>VRB</b> for variable)<br>
        SSS  = Speed <br>
        XX  = Gust speed<br>
        UUU = Units, one of: </p>
      <p><b>KMH</b> = Kilometers per hour</p>
      <p><b>KT</b> = Knots</p>
      <p><b>MPS</b> = Meters per second</p>
      <p>&nbsp;</p>
      <p><i>Flight Simulator</i> extension follows the &quot;<b>&amp;</b>&quot; character<br>
            <br>
        Format of the extension is <b>&amp;D</b>NNNNTS<br>
      </p>
      <p>where<br>
        NNNN is the depth in meters (default is 1000 feet or 305m)</p>
      <p><br>
        T part is turbulence, one of: <br>
        <b>N</b> - None (default)<br>
        <b>O</b> or <b>L</b> - Light<br>
        <b>M</b> - Moderate</p>
      <p><b>H</b> - Heavy <br>
            <b>S</b> - Severe<br>
            <br>
        S part is wind shear, one of: <br>
        <b>G</b> - Gradual (default)<br>
        <b>M</b> - Moderate<br>
        <b>S</b> - Steep<br>
        <b>I</b> - Instantaneous<br>
        <br>
        The  default extension would look like this: <b>&amp;D305NG</b></p></td>
    <td>No</td>
  </tr>
  <tr>
    <td>WINDS ALOFT<a name="WINDSALOFT"></a> (this section is entirely an extension)</td>
    <td><p>Normal Metar strings do not contain winds aloft, so this whole entry is an  extension. Winds aloft can be entered in one of two formats, but do not use both. The first format is slightly more flexible than the second, and follows SURFACE WINDS, the second format is at the end of the metar string:</p>
      <p>&nbsp;</p>
      <p>Format 1: </p>
      <p>&nbsp;</p>
      <p> This repeats the surface wind data but instead of specifying a surface layer depth  it specifies a base altitude.  The  extension format is <b>&amp;A</b>NNNNTS. (note the <b>A</b> for altitude instead of <b>D</b> for depth). The format is otherwise the same as for surface winds, including the extension giving the depth, turbulence and windshear.</p>
      <p>&nbsp;</p>
      <p>Format 2:</p>
      <p>&nbsp;</p>
      <p><b>@@@</b> A T D S<b> |</b> A T D S | ..... </p>
      <p>&nbsp;</p>
      <p>where</p>
      <p>A is altitude in 100s of feet (-1500 to 100000) </p>
      <p>T is temperature in celcius (-250 to 100) </p>
      <p>D is direction in degrees (0 to 360) </p>
      <p>S is speed in knots  (0 to 400) </p>
      <p>&nbsp;</p>
      <p>Note that there can be more than one WINDS ALOFT entry, typically giving different wind strengths and the other data, for a range of altitudes. </p></td>
    <td>Yes</td>
  </tr>
  <tr>
    <td>MIN MAX WIND DIR</td>
    <td>XXX<b>V</b>YYY<br>
        <br>
      XXX - start of heading range, in degrees <br>
      YYY - end of heading range, in degrees <br></td>
    <td>No</td>
  </tr>
  <tr>
    <td>CAVOK</td>
    <td>Optional <b>CAVOK</b> keyword (meaning Ceiling and Visibility OK). It indicates that no clouds exist below 5,000 feet or below the highest minimum sector altitude, whichever is greater, and no cumulonimbus are present. Also the visibility is 10 kilometers or more and, no precipitation, thunderstorms, sandstorm, duststorm, shallow fog, or low drifting dust, sand or snow is occurring. </td>
    <td>No</td>
  </tr>
  <tr>
    <td>VISIBILITY (has an extension)</td>
    <td><p>Like winds aloft the visibility group can be repeated to describe multiple visibility layers. There is also an  extension to the format to allow layer base and depth to be specified.</p>
        <p>&nbsp;</p>
      <p>Use one of the following formats: </p>
      <p>&nbsp;</p>
      <p>Statute Miles: </p>
      <p><b>M1/4SM</b> or <b>&lt;1/4SM</b> (visibility is less that a quarter of a statute mile) </p>
      <p>I<b>SM</b> (visibility is measured in an interger number of statue miles) </p>
      <p>N/D<b>SM</b> (visibility is measured as a fraction of a statue mile) </p>
      <p>I N/D<b>SM</b> (visibility is measured in a whole part and fraction of a statue mile)</p>
      <p>&nbsp;</p>
      <p>where<br>
        I = Integer part<br>
        N = Numerator<br>
        D = Denominator</p>
      <p>&nbsp;</p>
      <p>The minimum fraction that can be entered is 1/8. Note that this is the only exception where a space can occur (between the I and the N) within a section.</p>
      <p>&nbsp; </p>
      <p> Kilometers: NN<b>KM</b></p>
      <p>&nbsp;</p>
      <p>Meters: 
        NNNND</p>
      <p>&nbsp;</p>
      <p>where<br>
        D is directional variation, one of: <br>
        <b>NDV</b> - no directional variation<br>
        <b>NE, NW, SE, SW, N, S, E, W</b> - compass point<br>
        <b>M</b> meters - same as <b>NDV</b><br>
        <br>
        <i>Flight Simulator</i> extension:<br>
        <br>
        Format is <b>&amp;B</b>XXXX<b>&amp;D</b>YYYY<br>
        <br>
        XXXX - base of visibility layer in meters<br>
        YYYY - depth of visibility layer in meters</p></td>
    <td>Yes</td>
  </tr>
  <tr>
    <td>RUNWAY VISUAL RANGE</td>
    <td><p>Use one of the following two formats: </p>
        <p><b>R</b>DD/VVVV<b>FT</b><br>
            <b>R</b>DD/XXXX<b>V</b>YYYY<b>FT</b><br>
        </p>
      <p>where<br>
        DD = Runway ID (1-6 characters)<br>
        VVVV = Visual range in feet. May have <b>P </b>(above maximum) or <b>M</b> (below minimum) prefix (following the slash). <br>
        XXXX = Varying minimum range in feet.<br>
        YYYY = Varying maximum range in feet. </p></td>
    <td>Yes</td>
  </tr>
  <tr>
    <td>PRESENT CONDITIONS</td>
    <td><p>IDDPP</p>
        <p>&nbsp;</p>
      <p>where:</p>
      <p>I  - Intensity or vicinity flag:. <b>-, + </b>or <b>VC</b>. - means light, + means severe, and VC means vicinity. The + and - can be combined with VC. Leave out a + or - to mean moderate. </p>
      <p>&nbsp;</p>
      <p>For example: <b>+VCTSRA</b> means severe thunderstorm with rain in the vicinity. </p>
      <p>&nbsp;</p>
      <p>DD - Descriptor, one of: <br>
            <b>MI</b> shallow <br>
            <b>PR</b> partial <br>
            <b>DC</b> patches <br>
            <b>DR</b> low drifting <br>
            <b>BL</b> blowing <br>
            <b>SH</b> shower <br>
            <b>TS</b> thunderstorm <br>
            <b>FZ</b> freezing </p>
      <p><br>
        PP - Phenomena, one of: </p>
      <p><br>
            <b>DZ</b> drizzle <br>
            <b>RA</b> rain <br>
            <b>SN</b> snow <br>
            <b>SG</b> snow grains <br>
            <b>IC</b> ice crystals <br>
            <b>PE</b> ice pellets <br>
            <b>GR</b> hail <br>
            <b>GS</b> small hail/snow pellets <br>
            <b>UP</b> unknown <br>
      </p>
      <p><b>BR</b> mist <br>
            <b>FG</b> fog <br>
            <b>FU</b> smoke <br>
            <b>VA</b> volcanic ash <br>
            <b>DU</b> dust <br>
            <b>SA</b> sand <br>
            <b>HZ</b> haze <br>
            <b>PY</b> spray </p>
      <p>&nbsp;</p>
      <p><b>PO</b> dust whirls <br>
            <b>SQ</b> squalls <br>
            <b>FC</b> funnel cloud/tornado/waterspout <br>
            <b>SS</b> sandstorm </p>
      <p><b>DS</b> duststorm</p></td>
    <td>Yes</td>
  </tr>
  <tr>
    <td>PARTIAL OBSCURATION</td>
    <td><p>One of: </p>
        <p>&nbsp;</p>
      <p><b>FEW///<br>
        SCT///<br>
        BKN///<br>
        FEW000<br>
        SCT000<br>
        BKN000</b></p>
      <p>&nbsp;</p>
      <p>These mean few, scattered or broken clouds are obscuring the view.</p></td>
    <td>No</td>
  </tr>
  <tr>
    <td>SKY CONDITIONS (has an extension)</td>
    <td><p>Note cloud heights are coded: If NNN is 999 the level is 100,000 feet, otherwise it is 100 x NNN in feet. </p>
        <p>&nbsp;</p>
        <p>CCCNNN</p>
        <p>&nbsp;</p>
        <p>Where NNN is the coded height, and CCC is one of:: </p>
      <p>&nbsp;</p>
      <p><b>CLR</b> or <b>        SKC</b> - sky clear </p>
      <p><b>FEW</b> - few clouds </p>
      <p><b>SCT</b> - scattered clouds </p>
      <p><b>BKN</b> - broken clouds </p>
      <p><b>OVC</b> - overcast</p>
      <p>NTT - N/8ths cloud coverage of type TT, which is one of: </p>
      <p><br>
        <b>CI</b> Cirrus<br>
        <b>CS</b> Cirro-stratus<br>
        <b>CC</b> Cirro-cumulus<br>
        <b>AS</b> Alto-stratus<br>
        <b>AC</b> Alto-cumulus<br>
        <b>SC</b> Strato-cumulus<br>
        <b>NS</b> Nimbo-stratus<br>
        <b>ST</b> Stratus<br>
        <b>CU</b> Cumulus<br>
        <b>CB</b> Cumulo-nimbus</p>
      <p>&nbsp;</p>
      <p><i>Flight Simulator</i> extension:<br>
            <br>
        &amp;TT000FTPQBBBI<br>
      </p>
      <p>where:<br>
        TT - Type, one of <b>CU</b> ( Cumulus ) or <b>CB</b> ( Cumulo-nimbus ) <br>
        000 - Unused. <br>
        F - Top of cloud, one of: <b>F</b> (flat), <b>R</b> (round), <b>A</b> (anvil) <br>
        T - Turbulence, one of: <b>N</b> - None (default), <b>O</b> - Light, <b>L</b> - Light,<b> M</b> - Moderate, <b>H</b> - Heavy, <b>S</b> - Severe<br>
        P - Precipitation, one of: <b>V</b> (very light), <b>L</b> (light), <b>M</b> (moderate), <b>H</b> (heavy) <b>D</b> (dense) <br>
        Q - Type of precipitation, one of: <b>N</b> (none), <b>R</b> (rain), <b>F</b> (freezing rain), <b>H</b> (hail), <b>S</b> (snow) <br>
        BBB - Coded base height, the precipitation ends at this height, set to 0 for it to land on the ground <br>
        I - icing rate, one of: <b>N</b> (none), <b>T</b> (trace), <b>L</b> (light), <b>M</b> (moderate), <b>S</b> (severe) <br>
      </p></td>
    <td>No</td>
  </tr>
  <tr>
    <td><p>TEMPERATURE</p>
        <p>(has an extension) </p></td>
    <td><p>TT/DD</p>
        <p>&nbsp;</p>
      <p>TT - temperature in celcius</p>
      <p>DD - dewpoint in celcius</p>
      <p>&nbsp;</p>
      <p>Negative values should be preceded with an <b>M</b>. </p>
      <p>&nbsp;</p>
      <p><i>Flight Simulator</i> extension:</p>
      <p><b>&amp;A</b>NNNNN - altitude of the temperatures in feet. </p></td>
    <td>Yes</td>
  </tr>
  <tr>
    <td>ALTIMITER</td>
    <td><p>One of:</p>
        <p>&nbsp;</p>
      <p><b>A</b>NNNN - altimeter in degrees of mercury (for example, <b>A2992</b>) </p>
      <p><b>Q</b>NNNN - altimeter in millibars</p>
      <p>&nbsp;</p></td>
    <td>No</td>
  </tr>
  <tr>
    <td>@@@</td>
    <td>If these three characters are entered in the string, there is a <a href="#WINDSALOFT">WINDS ALOFT</a> section following the metar string. </td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<h6>Examples of Metar strings </h6>
<p>&nbsp; </p>
<table class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><b>Metar String </b></td>
    <td><b>Description</b></td>
  </tr>
  <tr>
    <td><b>KSEA&nbsp;030405Z&nbsp;27007KT&nbsp;15SM&nbsp;SKC&nbsp;17/13&nbsp;A2992</b></td>
    <td>KSEA = Station Identifier (Sea-Tac airport) <br>
030405Z = Time (ddhhmmZ) <br>
27007KT = Winds (270 degrees at 7 knots) <br>
15SM = Visibility (15 statute miles) <br>
SKC = Clear skies <br>
17/13 = Temperature /Dewpoint in celsius <br>
A2992 = Altimieter setting (29.92 in Hg) </td>
  </tr>
  <tr>
    <td><b>KSEA&nbsp;030405Z&nbsp;COR&nbsp;27015KT&nbsp;7SM&nbsp;+TSRA&nbsp;BKN055CB&nbsp;30/17&nbsp;A2974</b></td>
    <td>Corrected report, same time as above, with 15 knot winds, 7 miles of visibility, severe thunderstorm and rain, broken cumulo-nimbus clouds at 5500 feet. </td>
  </tr>
  <tr>
    <td><p><b>KSEA&amp;A131 000000Z   00000KT&amp;D985NG 100KM&amp;B-581&amp;D3048 2CU053&amp;CU000FNMN-19N 15/05   Q1013 @@@ 65 15 270 20 | 196 15 270 25 | </b></p></td>
    <td>Fair weather at Sea-Tac airport. Two eights cumulous clouds at 5300 feet, 20 knot West winds at 6500 feet,  25 knot West winds at 19600 feet. </td>
  </tr>
</table>
<p>&nbsp;</p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_WeatherRequestInterpolatedObservation"><b>SimConnect_WeatherRequestInterpolatedObservation</b></a></li>
  <li><a href="#SimConnect_WeatherRequestObservationAtStation"><b>SimConnect_WeatherRequestObservationAtStation</b></a></li>
  <li><a href="#SimConnect_WeatherRequestObservationAtNearestStation"><b>SimConnect_WeatherRequestObservationAtNearestStation</b></a></li>
  <li><a href="#SimConnect_WeatherSetModeServer"><b>SimConnect_WeatherSetModeServer</b></a></li>
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a></li>
</ul>
<HR><BR>

<h2><a name="SimConnect_Structures_and_Enumerations"></a>SimConnect
Structures and Enumerations</h2>

<p>SimConnect uses the following structures and enumerations.<br>
</p>

<br>

<table border="10" bordercolor="#dddddd" cellpadding="2" cellspacing="2" width="670">

  <tbody>

    <tr>

      <td><h5>Name</h5></td>

      <td><h5>Structure or Enumeration </h5></td>
      <td>
      <h5>Description</h5>      </td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined"><a style="font-weight: bold;" href="#SIMCONNECT_DATATYPE">SIMCONNECT_DATATYPE</a></td>

      <td align="undefined" valign="undefined">Enum</td>
      <td align="undefined" valign="undefined"> Used with the <a style="font-weight: bold;" href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a> call to specify the data type that the server should use to return the specified data to the client. </td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><a style="font-weight: bold;" href="#SIMCONNECT_DATA_INITPOSITION">SIMCONNECT_DATA_INITPOSITION</a></td>
      <td align="undefined" valign="undefined">Struct</td>
      <td align="undefined" valign="undefined"> Used to initialize the position of a the user or AI controlled aircraft.</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><b><a href="#SIMCONNECT_DATA_LATLONALT">SIMCONNECT_DATA_LATLONALT</a></b></td>
      <td align="undefined" valign="undefined">Struct</td>
      <td align="undefined" valign="undefined">Used to hold a world position. </td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><a href="#SIMCONNECT_DATA_MARKERSTATE"><span style="font-weight: bold;">SIMCONNECT_DATA_MARKERSTATE</span></a></td>
      <td align="undefined" valign="undefined">Struct</td>
      <td align="undefined" valign="undefined">Used to help graphically link flight model data with the graphics model.</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><b><a href="#SIMCONNECT_DATA_WAYPOINT">SIMCONNECT_DATA_WAYPOINT</a></b> </td>
      <td align="undefined" valign="undefined">Struct</td>
      <td align="undefined" valign="undefined">Used to hold all the necessary information on a waypoint. </td>
    </tr>



    <tr>
      <td><b><a href="#SIMCONNECT_DATA_XYZ">SIMCONNECT_DATA_XYZ</a></b></td>
      <td>Struct</td>
      <td>Used to hold a 3D co-ordinate. </td>
    </tr>
    <tr>

      <td><a href="#SIMCONNECT_EXCEPTION"><b>SIMCONNECT_EXCEPTION</b></a></td>

      <td>Enum</td>
      <td>
      <p> Used with the&nbsp;<a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a><span style="text-decoration: underline;"><span style="font-weight: bold;"> </span></span>structure
to return information on an error that has occured.</p>      </td>
    </tr>
	
<tr><td><A HREF="#SIMCONNECT_MISSION_END"><B>SIMCONNECT_MISSION_END</B></A></td><td>Enum</td><td><p>Used to specifiy the three possible outcomes of a mission.</p></td></tr>
<tr>
  <td><a href="#SIMCONNECT_PERIOD"><b>SIMCONNECT_PERIOD</b></a></td>
  <td>Enum</td>
  <td><p> Used with the <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a> call to specify how often data is to be sent to the client.</p></td>
</tr>

    <tr>

      <td><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></td>

      <td>Struct</td>
      <td>
      <p>Used with the&nbsp;<a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a>
enumeration to indicate which type of structure has been returned.</p>      </td>
    </tr><tr>

      <td><a href="#SIMCONNECT_RECV_ASSIGNED_OBJECT_ID"><b>SIMCONNECT_RECV_ASSIGNED_OBJECT_ID</b></a></td>

      <td>Struct</td>
      <td>
      <p> Used to return an object ID that matches a request ID.</p>      </td>
    </tr>
	
	<tr>
	  <td><A HREF="#SIMCONNECT_RECV_CLIENT_DATA"><B>SIMCONNECT_RECV_CLIENT_DATA</B></A></td>
	  <td>Struct</td>
	  <td>Will be received by the client after a successful
call&nbsp;to&nbsp;<A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A><a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType"></a>. The structure is identical to <a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a>.</td>
    </tr>
	<tr>
	  <td><b><a href="#SIMCONNECT_RECV_CLOUD_STATE">SIMCONNECT_RECV_CLOUD_STATE</a></b></td>
	  <td>Struct</td>
	  <td>Used to return an array of cloud state data. </td>
    </tr>
	<tr><td><A HREF="#SIMCONNECT_RECV_CUSTOM_ACTION"><B>SIMCONNECT_RECV_CUSTOM_ACTION</B></A></td><td>Struct</td><td><p>Used specifically with the mission system, providing details on the custom action that has been triggered.</p></td></tr>
  <td><a href="#SIMCONNECT_RECV_EVENT"><b>SIMCONNECT_RECV_EVENT</b></a></td>

      <td>Struct</td>
      <td>
      <p>Used to return an event ID to the client.</p>      </td>
    </tr>

    <tr>

      <td><a href="#SIMCONNECT_RECV_EVENT_FILENAME"><b>SIMCONNECT_RECV_EVENT_FILENAME</b></a></td>

      <td>Struct</td>
      <td>
      <p>Used with the <b><a href="#SimConnect_SubscribeToSystemEvent">SimConnect_SubscribeToSystemEvent</a></b> to return a filename and an event ID to the client.</p>      </td>
    </tr>
<tr><td><A HREF="#SIMCONNECT_RECV_EVENT_FRAME"><B>SIMCONNECT_RECV_EVENT_FRAME</B></A></td><td>Struct</td><td><p>Used with the <b><a href="#SimConnect_SubscribeToSystemEvent">SimConnect_SubscribeToSystemEvent</a></b> to return the frame rate and simulation speed to the client.</p></td></tr>
<tr><td><A HREF="#SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE"><B>SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE</B></A></td><td>Struct</td><td><p>Used to return the type and ID of an AI object that has been added or removed from the simulation, by any client.</p></td></tr>


    <tr>

      <td><a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a></td>

      <td>Struct</td>
      <td>
      <p> Used with the <a style="font-weight: bold;" href="#SIMCONNECT_EXCEPTION">SIMCONNECT_EXCEPTION</a>
enumeration type to return information on an error that has occured.</p>      </td>
    </tr>

    <tr>

      <td><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></td>

      <td>Enum</td>
      <td>
      <p>Used within <span style="font-family: &quot;Times New Roman&quot;;">the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a>
structure</span> to indicate which type of structure has been
returned.</p>      </td>
    </tr>

    <tr>
      <td><A HREF="#SIMCONNECT_RECV_OPEN"><B>SIMCONNECT_RECV_OPEN</B></A></td>
      <td>Struct</td>
      <td><p>Used to return information to the client, after a successful call to <a href="#SimConnect_Open"><b>SimConnect_Open</b></a>.</p></td>
    </tr>
    <tr>
      <td><b><a href="#SIMCONNECT_RECV">SIMCONNECT_RECV_QUIT</a></b></td>
      <td>Struct</td>
      <td>This is an identical structure to  <span style="font-family: &quot;Times New Roman&quot;;">the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a> structure.</span></td>
    </tr>
    <tr>
      <td><A HREF="#SIMCONNECT_RECV_RESERVED_KEY"><B>SIMCONNECT_RECV_RESERVED_KEY</B></A></td>
      <td>Struct</td>
      <td><p>Used with the <A HREF="#SimConnect_RequestReservedKey"><B>SimConnect_RequestReservedKey</B></A> function to return the reserved key combination. </p></td>
    </tr>
    <tr>

      <td><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a></td>

      <td>Struct</td>
      <td>
      <p>Will be received by the client after a successful call
to&nbsp;<a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a> or <a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>.</p>      </td>
    </tr>

    <tr>

      <td><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE"><b>SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</b></a></td>

      <td>Struct</td>
      <td>
      <p>Will be received by the client after a successful
call&nbsp;to&nbsp;<a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>. The structure is identical to <a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a>.</p>      </td>
    </tr>

    <tr>
      <td><b><a href="#SIMCONNECT_RECV_SYSTEM_STATE">SIMCONNECT_RECV_SYSTEM_STATE</a></b></td>
      <td>Struct</td>
      <td>Used with the <b><a href="#SimConnect_RequestSystemState">SimConnect_RequestSystemState</a></b> function to retrieve specific <i>Flight Simulator</i> systems states and information.</td>
    </tr>
    <tr>
      <td><a href="#SIMCONNECT_RECV_WEATHER_OBSERVATION"><b>SIMCONNECT_RECV_WEATHER_OBSERVATION</b></a></td>
      <td>Struct</td>
      <td><p>Used to return weather observation data, after calls to one of:</p>
        <a href="#SimConnect_WeatherRequestInterpolatedObservation"><b>SimConnect_WeatherRequestInterpolatedObservation</b></a>, 
          <a href="#SimConnect_WeatherRequestObservationAtStation"><b>SimConnect_WeatherRequestObservationAtStation</b></a>, or
          <a href="#SimConnect_WeatherRequestObservationAtNearestStation"><b>SimConnect_WeatherRequestObservationAtNearestStation</b></a>.      </td>
    </tr>
    <tr>

      <td><a href="#SIMCONNECT_SIMOBJECT_TYPE"><b>SIMCONNECT_SIMOBJECT_TYPE</b></a></td>

      <td>Enum</td>
      <td>
      <p>Used with the &nbsp;<a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>
call to request information on specific or nearby objects.</p>      </td>
    </tr>

    <tr>

      <td><a href="#SIMCONNECT_STATE"><b>SIMCONNECT_STATE</b></a></td>

      <td>Enum</td>
      <td>
      <p> Used with the&nbsp;<a style="font-weight: bold;" href="#SimConnect_SetSystemEventState">SimConnect_SetSystemEventState</a>
call to turn the reporting of events on and off.</p>      </td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined"><b><a href="#SIMCONNECT_WAYPOINT_FLAGS">SIMCONNECT_WAYPOINT_FLAGS</a></b></td>
      <td align="undefined" valign="undefined">Enum</td>
      <td align="undefined" valign="undefined">Used with the <b><a href="#SIMCONNECT_DATA_WAYPOINT">SIMCONNECT_DATA_WAYPOINT</a></b> structure to define waypoints.</td>
    </tr>
  </tbody>
</table>

<br><hr><br>

<a name="SIMCONNECT_DATATYPE"></a>
<h3>SIMCONNECT_DATATYPE</h3>

<p>The <b>SIMCONNECT_DATATYPE</b> enumeration type is
used with the <a style="font-weight: bold;" href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a>
call to specify the data type that the server should use to return the specified data to the client. </p>

<h4>Syntax</h4>

<code><b>enum SIMCONNECT_DATATYPE{</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_INVALID</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_INT32</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_INT64</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_FLOAT32</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_FLOAT64</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_STRING8</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_STRING32</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_STRING64</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_STRING128</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_STRING256</b><span style="font-weight: bold;">,</span><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_STRING260</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_STRINGV</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_INITPOSITION,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_MARKERSTATE,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_WAYPOINT,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_LATLONALT,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_XYZ,</b><br>
<br>

</b>&nbsp;&nbsp;<b>SIMCONNECT_DATATYPE_MAX</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>SIMCONNECT_DATATYPE_FLOAT32,64</b><br>
&nbsp;&nbsp;Specifies a 32 bit or 64 bit floating point number. </p>
<p><br>

  <b>SIMCONNECT_DATATYPE_STRING8,32,64,128,256,260</b></p>
<p>&nbsp;&nbsp;Specifies strings of the given length (8 characters to 260 characters) <br>
  <br>
  
  <b>SIMCONNECT_DATATYPE_STRINGV</b><br>
  &nbsp;&nbsp;Specifies a variable length string.</p>
<p><br>

  <b>SIMCONNECT_DATATYPE_INITPOSITION</b><br>
&nbsp;&nbsp;Specifies the <a href="#SIMCONNECT_DATA_INITPOSITION"><b>SIMCONNECT_DATA_INITPOSITION</b></a> structure.</p>
<p><br>

  <b>SIMCONNECT_DATATYPE_MARKERSTATE</b><br>
&nbsp;&nbsp;Specifies the <a href="#SIMCONNECT_DATA_MARKERSTATE"><b>SIMCONNECT_DATA_MARKERSTATE</b></a> structure.</p>
<p><br>

  <b>SIMCONNECT_DATATYPE_WAYPOINT</b><br>
&nbsp;&nbsp;Specifies the <a href="#SIMCONNECT_DATA_WAYPOINT"><b>SIMCONNECT_DATA_WAYPOINT</b></a> structure.</p>
<BR>

  <b>SIMCONNECT_DATATYPE_LATLONALT</b><br>
&nbsp;&nbsp;Specifies the <a href="#SIMCONNECT_DATA_LATLONALT"><b>SIMCONNECT_DATA_LATLONALT</b></a> structure.</p>
<p><br>

  <b>SIMCONNECT_DATATYPE_XYZ</b><br>
&nbsp;&nbsp;Specifies the <a href="#SIMCONNECT_DATA_XYZ"><b>SIMCONNECT_DATA_XYZ</b></a> structure.</p>

<h4>Working Samples</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#RequestData">Request Data </a></p>
        <p><a href="#SetData">Set Data </a></p>
      <p><a href="#TaggedData">Tagged Data</a></p>
      <p><a href="#ThrottleControl">Throttle Contol </a></p></td>
  </tr>
</table>
<h4>Remarks</h4>

<p>The three structures in the list of data types can only be used as input (using <b><a href="#SimConnect_SetDataOnSimObject">SimConnect_SetDataOnSimObject</a></b>) and not to receive requested data.</p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference</b></a></li>

  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>

<br>

<hr><br>

<a name="SIMCONNECT_PERIOD"></a>
<h3>SIMCONNECT_PERIOD</h3>

<p>The <b>SIMCONNECT_PERIOD</b>
enumeration type is used with the <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a>
call to specify how often data is to be sent to the client.</p>

<h4>Syntax</h4>

<code><b>enum SIMCONNECT_PERIOD{</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_PERIOD_NEVER,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_PERIOD_ONCE,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_PERIOD_VISUAL_FRAME,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_PERIOD_SIM_FRAME,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_PERIOD_SECOND,</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>SIMCONNECT_PERIOD_NEVER</b><br>

&nbsp;&nbsp;Specifies that the data is not to be sent.</p>
<p><br>

  <b>SIMCONNECT_PERIOD_ONCE</b><br>
&nbsp;&nbsp;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. </p>
<p><br>

  <b>SIMCONNECT_PERIOD_VISUAL_FRAME</b><br>
&nbsp;&nbsp;Specifies that the data should be sent every visual (rendered) frame.</p>
<p><br>

  <b>SIMCONNECT_PERIOD_SIM_FRAME</b><br>
&nbsp;&nbsp;Specifies that the data should be sent every simulated frame, whether that frame is rendered or not.</p>
<p><br>

  <b>SIMCONNECT_PERIOD_SECOND</b><br>
&nbsp;&nbsp;Specifies that the data should be sent once every
second.</p>
<h4>Working Samples</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#TaggedData">Tagged Data</a></p>
        <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td><a href="#WeatherStation">Weather Station </a></td>
  </tr>
</table>
<p></p>
<h4>Remarks</h4>

<p>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. </p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a> </li>

  <li><a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a></li>
  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>

<br><hr><br>

<a name="SIMCONNECT_EXCEPTION"></a>
<h3>SIMCONNECT_EXCEPTION</h3>

<p>The <b>SIMCONNECT_EXCEPTION</b> enumeration type
is used with the&nbsp;<a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a><span style="text-decoration: underline;"><span style="font-weight: bold;"> </span></span>structure
to return information on an error that has occured.</p>

<h4>Syntax</h4>

<p><code><b>enum SIMCONNECT_EXCEPTION{</b><br>
  &nbsp;&nbsp;<b>SIMCONNECT_EXCEPTION_NONE = 0,</b><br>
  &nbsp;&nbsp;<b>SIMCONNECT_EXCEPTION_ERROR = 1,</b><br>
  &nbsp;&nbsp;<b>SIMCONNECT_EXCEPTION_SIZE_MISMATCH = 2,</b><br>
  &nbsp;&nbsp;<b>SIMCONNECT_EXCEPTION_UNRECOGNIZED_ID = 3,</b><br>
  &nbsp;&nbsp;<b>SIMCONNECT_EXCEPTION_UNOPENED = 4,</b><br>
  &nbsp;&nbsp;<b>SIMCONNECT_EXCEPTION_VERSION_MISMATCH = 5,</b><br>
  &nbsp;&nbsp;<b>SIMCONNECT_EXCEPTION_TOO_MANY_GROUPS = 6,</b><br>
  &nbsp;&nbsp;<b>SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED = 7,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_TOO_MANY_EVENT_NAMES = 8,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_EVENT_ID_DUPLICATE = 9,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_TOO_MANY_MAPS = 10,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_TOO_MANY_OBJECTS = 11,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_TOO_MANY_REQUESTS = 12,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_WEATHER_INVALID_PORT = 13,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_WEATHER_INVALID_METAR = 14,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_GET_OBSERVATION = 15,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_CREATE_STATION = 16,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_REMOVE_STATION = 17,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_INVALID_DATA_TYPE = 18,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_INVALID_DATA_SIZE = 19,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_DATA_ERROR = 20,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_INVALID_ARRAY = 21,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_CREATE_OBJECT_FAILED = 22,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_LOAD_FLIGHTPLAN_FAILED = 23,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_OPERATION_INVALID_FOR_OJBECT_TYPE = 24,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_ILLEGAL_OPERATION = 25,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_ALREADY_SUBSCRIBED = 26,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_INVALID_ENUM = 27,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_DEFINITION_ERROR = 28,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_DUPLICATE_ID = 29,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_DATUM_ID = 30,<br>
  &nbsp;&nbsp;SIMCONNECT_EXCEPTION_OUT_OF_BOUNDS = 31,<br>
  </b><br>
  
  <b>};</b><br>
  
  <br>
  </code>
</p>
<h4>Members</h4>
<h6>General errors</h6>
<p><B>SIMCONNECT_EXCEPTION_NONE</B><BR>
&nbsp;&nbsp;Specifies SIMCONNECT_EXCEPTION_NONE .</p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_ERROR</B><BR>
&nbsp;&nbsp;Specifies SIMCONNECT_EXCEPTION_ERROR . </p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_SIZE_MISMATCH</B><BR>
&nbsp;&nbsp;Specifies SIMCONNECT_EXCEPTION_SIZE_MISMATCH . </p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_UNRECOGNIZED_ID</B><BR>
&nbsp;&nbsp;Specifies that the client event, request ID, data definition ID, or object ID was not recognized. </p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_UNOPENED</B><BR>
&nbsp;&nbsp;Specifies SIMCONNECT_EXCEPTION_UNOPENED . </p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_VERSION_MISMATCH</B><BR>
&nbsp;&nbsp;Specifies SIMCONNECT_EXCEPTION_VERSION_MISMATCH . </p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_TOO_MANY_GROUPS</B><BR>
&nbsp;&nbsp;Specifies that the maximum number of groups allowed has been reached. The maximim is 20.</p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED</B><BR>
&nbsp;&nbsp;Specifies that the simulation event name (such as &quot;brakes&quot;) is not recognised.</p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_TOO_MANY_EVENT_NAMES</B><BR>
&nbsp;&nbsp;Specifies  that the maximum number of event names allowed has been reached. The maximim is 1000.</p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_EVENT_ID_DUPLICATE</B><BR>
&nbsp;&nbsp;Specifies that the event ID has been used already. </p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_TOO_MANY_MAPS</B><BR>
&nbsp;&nbsp;Specifies  that the maximum number of mappings allowed has been reached. The maximim is 20.</p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_TOO_MANY_OBJECTS</B><BR>
&nbsp;&nbsp;Specifies  that the maximum number of objects allowed has been reached. The maximim is 1000.</p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_TOO_MANY_REQUESTS</B><BR>
&nbsp;&nbsp;Specifies  that the maximum number of requests allowed has been reached. The maximim is 1000.</p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_INVALID_DATA_TYPE</B><BR>
&nbsp;&nbsp;Specifies that the data type requested does not apply to the type of data requested.</p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_INVALID_DATA_SIZE</B><BR>
&nbsp;&nbsp;Specifies SIMCONNECT_EXCEPTION_INVALID_DATA_SIZE . </p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_DATA_ERROR</B><BR>
&nbsp;&nbsp;Specifies SIMCONNECT_EXCEPTION_DATA_ERROR . </p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_INVALID_ARRAY</B><BR>
&nbsp;&nbsp;Specifies SIMCONNECT_EXCEPTION_INVALID_ARRAY .</p><br>
<p><B>SIMCONNECT_EXCEPTION_ALREADY_SUBSCRIBED</B><BR>
&nbsp;&nbsp;Specifies that the client has already subscribed to that event.</p>
<p><BR>
 <B>SIMCONNECT_EXCEPTION_INVALID_ENUM</B><BR>
&nbsp;&nbsp;Specifies that the member of the enumeration provided was not valid.</p>
<p>&nbsp;</p>
<p><B>SIMCONNECT_EXCEPTION_DEFINITION_ERROR</B><BR>
&nbsp;&nbsp;Specifies that there is a problem with a data definition.<br>
</p>
<p><B>SIMCONNECT_EXCEPTION_DUPLICATE_ID</B><BR>
&nbsp;&nbsp;Specifies that the ID has already been used.<br>
</p>
<p><B>SIMCONNECT_EXCEPTION_DATUM_ID</B><BR>
&nbsp;&nbsp;Specifies that the datum ID is not recognized.<br>
</p>
<p><B>SIMCONNECT_EXCEPTION_OUT_OF_BOUNDS</B><BR>
&nbsp;&nbsp;Specifies that the radius given in the <a href="#SimConnect_RequestDataOnSimObjectType"><b>SimConnect_RequestDataOnSimObjectType</b></a> was outside the acceptable range.<br>
</p>
<h6>Weather system errors</h6>
<p><B>SIMCONNECT_EXCEPTION_WEATHER_INVALID_PORT</B><BR>
&nbsp;&nbsp;Specifies an invalid port number was requested. </p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_WEATHER_INVALID_METAR</B><BR>
&nbsp;&nbsp;Specifies that the metar data supplied did not match the required format. See the section <a href="#Metar_Data_Format">Metar Data Format</a> for details on the format required.</p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_GET_OBSERVATION</B><BR>
&nbsp;&nbsp;Specifies that the weather observation requested was not available. </p>

<p><BR>
  <B>SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_CREATE_STATION</B><BR>
&nbsp;&nbsp;Specifies that the weather station could not be created. </p>

<p><BR>
  <B>SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_REMOVE_STATION</B><BR>
&nbsp;&nbsp;Specifies that the weather station could not be removed. </p>
<p>&nbsp;</p>
<h6>AI errors</h6>
<p><B>SIMCONNECT_EXCEPTION_CREATE_OBJECT_FAILED</B><BR>
&nbsp;&nbsp;Specifies that the attempt to create an AI object failed. <BR>
</p>
<p><B>SIMCONNECT_EXCEPTION_LOAD_FLIGHTPLAN_FAILED</B><BR>
&nbsp;&nbsp;Specifies that the specified flight plan could not be found, or did not load correctly.</p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_OPERATION_INVALID_FOR_OBJECT_TYPE</B><BR>
&nbsp;&nbsp;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. </p>
<p><BR>
  <B>SIMCONNECT_EXCEPTION_ILLEGAL_OPERATION</B><BR>
&nbsp;&nbsp;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. </p>
<h4>Working Sample</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample </h5></td>
    <td><p><a href="#TrackingErrors">Tracking Errors </a></p>    </td>
  </tr>
</table>
<p>&nbsp;</p>

<h4>Remarks</h4>

<p style="margin-left: 0px; width: 920px;">In the context
of
SimConnect, exceptions are error codes, and should not be confused with
the C# or system concepts of exceptions. Refer to the remarks for <a href="#SimConnect_GetLastSentPacketID"><span style="font-weight: bold;">SimConnect_GetLastSentPacketID</span></a>.</p>

<h4>See Also</h4>

<ul>

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a></li>
  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>
<BR><HR><BR>
<A NAME="SIMCONNECT_MISSION_END"></A><H3>SIMCONNECT_MISSION_END</H3>
<p>The <B>SIMCONNECT_MISSION_END</B> enumeration type is used to specifiy the three possible outcomes of a mission.</p>
<H4>Syntax</H4>
<CODE><B>enum SIMCONNECT_MISSION_END{</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_MISSION_FAILED</B><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_MISSION_CRASHED</B><B>,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_MISSION_SUCCEEDED</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>SIMCONNECT_MISSION_FAILED</B><BR>
&nbsp;&nbsp;Specifies that the user did not complete the mission successfully</p>
<p>. <BR>
  <B>SIMCONNECT_MISSION_CRASHED</B><BR>
&nbsp;&nbsp;Specifies that the user aircraft crashed during the mission.</p>
<p><BR>
  <B>SIMCONNECT_MISSION_SUCCEEDED</B><BR>
&nbsp;&nbsp;Specifies that the user completed the mission successfully.</p>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><a href="#MissionAction">Mission Action </a></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>Refer to the mission events that can be requested by the <a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a> function. Also see the remarks for<A HREF="#SimConnect_CompleteCustomMissionAction"><B> SimConnect_CompleteCustomMissionAction</B></A>.</p>
<H4>See Also</H4>
<UL type="disc"><li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference</b></a></li>
  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
    Structures
    and Enumerations</b></a></li>
</UL>
<br>

<hr><br>

<a name="SIMCONNECT_RECV"></a>
<h3>SIMCONNECT_RECV</h3>

<p>The <b>SIMCONNECT_RECV</b> structure is used with
the&nbsp;<a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a>
enumeration to indicate which type of structure has been
returned.&nbsp;</p>

<h4>Syntax</h4>

<code><b>struct SIMCONNECT_RECV{</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwSize</b><b>;</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwVersion</b><b>;</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwID</b><b>;</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>dwSize</b><br>

&nbsp;&nbsp; The total size of the returned structure in bytes
(that is, not usually the size of the <span style="font-weight: bold;">SIMCONNECT_RECV</span>
structure, but of the
structure that inherits it).<br>

<b>dwVersion</b><br>

&nbsp;&nbsp; The version number of the SimConnect server.<br>

<b>dwID</b><br>

&nbsp;&nbsp; The ID of the returned structure. One member of <a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a>.</p>

<h4>Working Samples</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#ClientEvent">Client Event</a></p>
      <p><a href="#NoCallback">No Callback </a></p>
      <p><a href="#TrackingErrors">Tracking Errors </a></p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td>All but a few of the other <a href="#WorkingSamples">samples</a> implement this structure. </td>
  </tr>
</table>
<h4>Remarks</h4>

<p>This stucture is inherited directly by:</p>

<ul>
  <li style="font-weight: bold;"><a href="#SIMCONNECT_RECV_ASSIGNED_OBJECT_ID">SIMCONNECT_RECV_ASSIGNED_OBJECT_ID</a></li>
   
  <li><b><a href="#SIMCONNECT_RECV_CLOUD_STATE">SIMCONNECT_RECV_CLOUD_STATE</a></b></li>
  <li style="font-weight: bold;"><a href="#SIMCONNECT_RECV_EXCEPTION">SIMCONNECT_RECV_EXCEPTION</a></li>

  <li style="font-weight: bold;"><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></li>

  <li><a style="font-weight: bold;" href="#SIMCONNECT_RECV_SIMOBJECT_DATA">SIMCONNECT_RECV_SIMOBJECT_DATA</a>&nbsp;</li>

  <li style="font-weight: bold;"><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE">SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</a></li>

  <li><b><a href="#SIMCONNECT_RECV_OPEN">SIMCONNECT_RECV_OPEN</a></b></li>
  <li><b><a href="#SIMCONNECT_RECV_RESERVED_KEY">SIMCONNECT_RECV_RESERVED_KEY</a></b></li>
  <li><b><a href="#SIMCONNECT_RECV_SYSTEM_STATE">SIMCONNECT_RECV_SYSTEM_STATE</a></b></li>
  <li><a href="#SIMCONNECT_RECV_WEATHER_OBSERVATION"><b>SIMCONNECT_RECV_WEATHER_OBSERVATION</b></a></li>
</ul>

<p>The structure is also inherited by <b>SIMCONNECT_RECV_QUIT</b>, which does not add any new members. This structure is received when the user quits <i>Flight Simulator</i>.</p>
<p>&nbsp;</p>
<p>This structure is inherited by the <a href="#SIMCONNECT_RECV_EVENT"><b>SIMCONNECT_RECV_EVENT</b></a> structure, which is inhertied by several other structures: </p>
<ul>
  <li><b><a href="#SIMCONNECT_RECV_CUSTOM_ACTION">SIMCONNECT_RECV_CUSTOM_ACTION</a></b></li>
  <li><a href="#SIMCONNECT_RECV_EVENT_FILENAME"><b>SIMCONNECT_RECV_EVENT_FILENAME</b></a></li>
  <li><b><a href="#SIMCONNECT_RECV_EVENT_FRAME">SIMCONNECT_RECV_EVENT_FRAME</a></b></li>
  <li><b><a href="#SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE">SIMCONENCT_RECV_EVENT_OBJECT_ADDREMOVE</a></b></li>
</ul>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>

  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>
<BR><HR><BR>
<A NAME="SIMCONNECT_RECV_ASSIGNED_OBJECT_ID"></A><H3>SIMCONNECT_RECV_ASSIGNED_OBJECT_ID</H3>
<p>The <B>SIMCONNECT_RECV_ASSIGNED_OBJECT_ID</B> structure is used to return an object ID that matches a request ID.</p>
<H4>Syntax</H4>
<CODE><B>struct SIMCONNECT_RECV_ASSIGNED_OBJECT_ID : public SIMCONNECT_RECV {</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwRequestID</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwObjectID</B><B>;</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>dwRequestID</B><BR>
&nbsp;&nbsp;Double word containing the client defined request ID.
<BR>
<B>dwObjectID</B><BR>
&nbsp;&nbsp;Double word containing the server defined object ID.</p>
<H4>Working Samples</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples</h5></td>
    <td><p><a href="#AIObjectsandWaypoints">AI Objects and Waypoints</a></p>
    <p><a href="#AITraffic">AI Traffic </a></p></td>
  </tr>
</table>
<H4>Remarks</H4>
<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a> structure and is returned when the <span style="font-weight: bold;">dwID</span> parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span> is set to <span style="font-weight: bold;">SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID</span><span style="text-decoration: underline;"><span style="font-weight: bold;"></span></span></span>.</p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SIMCONNECT_RECV"><B>SIMCONNECT_RECV</B></A></li>
<LI><A HREF="#SIMCONNECT_RECV_EXCEPTION"><B>SIMCONNECT_RECV_EXCEPTION</B></A></li>
<LI><A HREF="#SIMCONNECT_RECV_ID"><B>SIMCONNECT_RECV_ID</B></A></li>
<LI><A HREF="#SIMCONNECT_RECV_SIMOBJECT_DATA"><B>SIMCONNECT_RECV_SIMOBJECT_DATA</B></A></li>
<li><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference</b></a></li>
<li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
  Structures
  and Enumerations</b></a></li>
</ul>
<BR><HR>
<br>
<a name="SIMCONNECT_RECV_CLIENT_DATA"></a>
<h3>SIMCONNECT_RECV_CLIENT_DATA</h3>
<p>The <b>SIMCONNECT_RECV_CLIENT_DATA</b> structure will be received by the client after a successful call
  to <A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A>. It is an identical structure to <a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a>.</p>
<h4>Syntax</h4>
<code><b>struct SIMCONNECT_RECV_CLIENT_DATA : public
SIMCONNECT_RECV_SIMBOBJECT_DATA{</b><br>
<b>};</b><br>
</code>
<h4>Remarks</h4>
<p><span style="font-family: &quot;Times New Roman&quot;;">This
  structure inherits the <a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a><a style="font-weight: bold;" href="#SIMCONNECT_RECV"></a> structure and is returned when the <span style="font-weight: bold;">dwID</span> parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span> is set to <span style="font-weight: bold;">SIMCONNECT_RECV_ID_CLIENT_DATA</span>.<span style="text-decoration: underline;"><span style="font-weight: bold;"></span></span></span></p>
<h4>See Also</h4>
<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a></li>
  <li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>
  <li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>
  <li><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a></li>
  <li><A HREF="#SimConnect_RequestClientData"><B>SimConnect_RequestClientData</B></A></li>
  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
    Structures
    and Enumerations</b></a> </li>
</ul>
<BR>
<HR>
<BR>
<A NAME="SIMCONNECT_RECV_CLOUD_STATE"></A><H3>SIMCONNECT_RECV_CLOUD_STATE</H3>
<p>The <B>SIMCONNECT_RECV_CLOUD_STATE</B> structure is used to return an array of cloud state data.</p>
<H4>Syntax</H4>
<CODE><B>struct SIMCONNECT_RECV_CLOUD_STATE : public SIMCONNECT_RECV {</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwRequestID</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwArraySize</B><B>;</B><BR>
&nbsp;&nbsp;<B>BYTE&nbsp;&nbsp;rgbData[1]</B><B>;</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>dwRequestID</B><BR>
&nbsp;&nbsp;Double word containing the client defined request ID.
<BR>
<B>dwArraySize</B><BR>
&nbsp;&nbsp;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 <b><a href="#SimConnect_WeatherRequestCloudState">SimConnect_WeatherRequestCloudState</a></b>. <br>
<B>rgbData[1]</B><BR>
&nbsp;&nbsp;Byte array containing.....
</p>
<H4>Working Samples</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples</h5></td>
    <td><p>&nbsp;</p>    </td>
  </tr>
</table>
<H4>Remarks</H4>
<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a> structure and is returned when the <span style="font-weight: bold;">dwID</span> parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span> is set to <span style="font-weight: bold;">SIMCONNECT_RECV_ID_CLOUD_STATE</span></span>.</p>
<H4>See Also</H4>
<UL type="disc">
<LI><A HREF="#SIMCONNECT_RECV"><B>SIMCONNECT_RECV</B></A></li>
<LI><A HREF="#SIMCONNECT_RECV_EXCEPTION"><B>SIMCONNECT_RECV_EXCEPTION</B></A></li>
<LI><A HREF="#SIMCONNECT_RECV_ID"><B>SIMCONNECT_RECV_ID</B></A></li>
<LI><a href="#SIMCONNECT_RECV_WEATHER_OBSERVATION"><b>SIMCONNECT_RECV_WEATHER_OBSERVATION</b></a></li>
<li><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference</b></a></li>
<li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
  Structures
  and Enumerations</b></a></li>
</UL>
<BR><HR><BR>

<A NAME="SIMCONNECT_RECV_CUSTOM_ACTION"></A><H3>SIMCONNECT_RECV_CUSTOM_ACTION</H3>
<p>The <B>SIMCONNECT_RECV_CUSTOM_ACTION</B> structure is used specifically with the mission system, providing details on the custom action that has been triggered.</p>
<H4>Syntax</H4>
<CODE><B>struct SIMCONNECT_RECV_CUSTOM_ACTION : public SIMCONNECT_RECV_EVENT {</B><BR>
&nbsp;&nbsp;<B>GUID&nbsp;&nbsp;guidInstanceId</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwWaitForCompletion</B><B>;</B><BR>
&nbsp;&nbsp;<B>char&nbsp;&nbsp;szPayLoad[1]</B><B>;</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>guidInstanceId</B><BR>
&nbsp;&nbsp;   GUID of the action that executed.
<BR>
<B>dwWaitForCompletion</B><BR>
&nbsp;&nbsp;   The value of the Wait-for-completion flag on the action.
<BR>
<B>szPayLoad</B><BR>
&nbsp;&nbsp;       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.</p>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><a href="#MissionAction">Mission Action </a></td>
  </tr>
</table>
<H4>Remarks</H4>
<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a> structure, which inherits the <b><a href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a></b> structure, and is returned when the <span style="font-weight: bold;">dwID</span> parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span> is set to <span style="font-weight: bold;">SIMCONNECT_RECV_ID_CUSTOM_ACTION</span></span>.</p>
<p>&nbsp;</p>
<p>See the remarks for<A HREF="#SimConnect_CompleteCustomMissionAction"><B> SimConnect_CompleteCustomMissionAction</B></A>.</p>
<H4>See Also</H4>
<UL type="disc"><LI><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference</b></a></li>
<li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
  Structures
  and Enumerations</b></a></li>
</UL>
<br>
<hr><br>

<a name="SIMCONNECT_RECV_EVENT"></a>
<h3>SIMCONNECT_RECV_EVENT</h3>

<p>The <b>SIMCONNECT_RECV_EVENT</b> structure is
used to return an event ID to the client.</p>

<h4>Syntax</h4>

<code><b>struct SIMCONNECT_RECV_EVENT : public SIMCONNECT_RECV {</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;uGroupID</b><b>;</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;uEventID</b><b>;</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwData</b><b>;</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>uGroupID</b><br>

&nbsp; The ID of the client defined group, or the special case
value: <b>UNKNOWN_GROUP</b> (which equals DWORD_MAX).
<br>

<b>uEventID</b><br>

&nbsp; The ID of the client defined event that has been requested
(such as EVENT_1 or EVENT_BRAKES from&nbsp;the examples in this
document).<br>

<b>dwData</b><br>

&nbsp;&nbsp; This value is usually zero, but some events
require further qualification. For example, joystick movement events require a movement value in addition to the notification that the joystick has been moved (see <b><a href="#SimConnect_MapInputEventToClientEvent">SimConnect_MapInputEventToClientEvent</a></b> for more information). </p>

<h4>Working Samples</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#ClientEvent">Client Event</a></p>
      <p><a href="#CockpitCamera">Cockpit Camera</a></p>
      <p><a href="#InputEvent">Input Event </a></p>
      <p><a href="#JoystickInput">Joystick Input</a></p>
      <p><a href="#MenuItems">Menu Items </a></p>
      <p><a href="#NoCallback">No Callback</a></p>
      <p><a href="#SendEventA">Send Event A </a></p>
      <p><a href="#SendEventB">Send Event B</a></p>
      <p><a href="#SendEventC">Send Event C</a></p>
      <p><a href="#ThrottleControl">Throttle Control</a></p>
      <p><a href="#TrackingErrors">Tracking Errors </a></p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td>All but a few of the other <a href="#WorkingSamples">samples</a> implement this structure. </td>
  </tr>
</table>
<h4>Remarks</h4>

<span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a>
structure and is returned when the <span style="font-weight: bold;">dwID</span>
parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span>
is set to
<span style="font-weight: bold;">SIMCONNECT_RECV_ID_EVENT</span></span>.
This structure is inherited by several other structures: 
<ul>
  <li><b><a href="#SIMCONNECT_RECV_CUSTOM_ACTION">SIMCONNECT_RECV_CUSTOM_ACTION</a></b></li>
  <li><a href="#SIMCONNECT_RECV_EVENT_FILENAME"><b>SIMCONNECT_RECV_EVENT_FILENAME</b></a></li>
  <li><b><a href="#SIMCONNECT_RECV_EVENT_FRAME">SIMCONNECT_RECV_EVENT_FRAME</a></b></li>
  <li><b><a href="#SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE">SIMCONENCT_RECV_EVENT_OBJECT_ADDREMOVE</a></b></li>
</ul>
<p>&nbsp;</p>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>
  <li><a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a></li>

  <li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>

  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>

<br>

<hr><br>

<a name="SIMCONNECT_RECV_EVENT_FILENAME"></a>
<h3>SIMCONNECT_RECV_EVENT_FILENAME</h3>

<p>The <b>SIMCONNECT_RECV_EVENT_FILENAME</b>
structure is used to return a filename and an event ID to the client.</p>

<h4>Syntax</h4>

<code><b>struct SIMCONNECT_RECV_EVENT_FILENAME : public SIMCONNECT_RECV_EVENT {</b><br>

&nbsp;&nbsp;<b>char&nbsp;&nbsp;szFileName[MAX_PATH]</b><b>;</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwFlags</b><b>;</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>szFileName[MAX_PATH]</b><br>

&nbsp;&nbsp;The returned filename.<br>

<b>dwFlags</b><br>

&nbsp; Reserved, should be 0.</p>

<h4>Working Sample</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#SystemEvent">System Event </a></p>    </td>
  </tr>
</table>
<h4>Remarks</h4>

<p>This structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a>
structure, and is used to attach a filename to the returned event.</p>

<p></p>

<span style="font-family: &quot;Times New Roman&quot;;">When the</span><span style="font-family: &quot;Times New Roman&quot;;"> <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a>
structure&nbsp;<span style="font-weight: bold;">dwID</span>
parameter&nbsp;is set to
<span style="font-weight: bold;">SIMCONNECT_RECV_EVENT_FILENAME</span></span>,
this structure is
returned.
<p></p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>
  <li><a href="#SIMCONNECT_RECV_EVENT"><b>SIMCONNECT_RECV_EVENT</b></a></li>

  <li><a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a></li>

  <li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>

  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>
<BR><HR><BR>
<A NAME="SIMCONNECT_RECV_EVENT_FRAME"></A><H3>SIMCONNECT_RECV_EVENT_FRAME</H3>
<p>The <B>SIMCONNECT_RECV_EVENT_FRAME</B> structure is used with the <b><a href="#SimConnect_SubscribeToSystemEvent">SimConnect_SubscribeToSystemEvent</a></b> call to return the frame rate and simulation speed to the client.</p>
<H4>Syntax</H4>
<CODE><B>struct SIMCONNECT_RECV_EVENT_FRAME : public SIMCONNECT_RECV_EVENT {</B><BR>
&nbsp;&nbsp;<B>float&nbsp;&nbsp;fFrameRate</B><B>;</B><BR>
&nbsp;&nbsp;<B>float&nbsp;&nbsp;fSimSpeed</B><B>;</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>fFrameRate</B><BR>
&nbsp;&nbsp;The visual frame rate in frames per second.</p>
<p><B>fSimSpeed</B><BR>
&nbsp;&nbsp;The simulation rate. For example if the simulation is running at four times normal speed - 4X - then 4.0 will be returned.</p>

<H4>Remarks</H4>
<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a> structure, which inherits the <b><a href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a></b> structure, and is returned when the <span style="font-weight: bold;">dwID</span> parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span> is set to <span style="font-weight: bold;">SIMCONNECT_RECV_ID_EVENT_FRAME</span></span>. Set the requested system event to &quot;<b>Frame</b>&quot; or &quot;<b>PauseFrame</b>&quot; with the <b><a href="#SimConnect_SubscribeToSystemEvent">SimConnect_SubscribeToSystemEvent</a></b> function to receive this data. </p>
<H4>See Also</H4>
<UL type="disc"><li><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference</b></a></li>
<li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
  Structures
  and Enumerations</b></a></li>
</UL>
<BR><HR><BR>
<A NAME="SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE"></A><H3>SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE</H3>
<p>The <B>SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE</B> 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.</p>
<H4>Syntax</H4>
<CODE><B>struct SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE : public SIMCONNECT_RECV_EVENT {</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_SIMOBJECT_TYPE&nbsp;&nbsp;eObjType</B><B>;</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>eObjType</B><BR>
&nbsp;&nbsp;Specifies the type of object that was added or removed. One member of the <b><a href="#SIMCONNECT_SIMOBJECT_TYPE">SIMCONNECT_SIMOBJECT_TYPE</a></b> enumeration. </p>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#AITraffic">AI Traffic </a></p>    </td>
  </tr>
</table>
<H4>Remarks</H4>
<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a> structure, which inherits the <b><a href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a></b> structure, and is returned when the <span style="font-weight: bold;">dwID</span> parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span> is set to <span style="font-weight: bold;">SIMCONNECT_RECV_ID_EVENT_ADDREMOVE</span></span>. A client can determine whether the object was added or removed from its own event ID that was provided as a parameter to  the <a href="#SimConnect_SubscribeToSystemEvent"><b>SimConnect_SubscribeToSystemEvent</b></a> function.</p>
<p>&nbsp;</p>
<p>The  ID of the object added or removed is returned in the <b>dwData</b> paramater (a member of the <span style="font-family: &quot;Times New Roman&quot;;"> <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a> structure</span>).</p>
<H4>See Also</H4>
<UL type="disc"><li><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference</b></a></li>
<li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
  Structures
  and Enumerations</b></a></li>
</UL>
<br>

<hr><br>

<a name="SIMCONNECT_RECV_EXCEPTION"></a>
<h3>SIMCONNECT_RECV_EXCEPTION</h3>

<p>The <b>SIMCONNECT_RECV_EXCEPTION</b> structure is
used with the <a style="font-weight: bold;" href="#SIMCONNECT_EXCEPTION">SIMCONNECT_EXCEPTION</a>
enumeration type to return information on an error that has occured.</p>

<h4>Syntax</h4>

<code><b>struct SIMCONNECT_RECV_EXCEPTION : public SIMCONNECT_RECV {</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwException</b><b>;</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwSendID</b><b>;</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwIndex</b><b>;</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>dwException</b><br>

&nbsp;&nbsp; One member of the <a style="font-weight: bold;" href="#SIMCONNECT_EXCEPTION">SIMCONNECT_EXCEPTION</a>
enumeration type, indicating which error has occured.<br>

<b>dwSendID</b><br>

&nbsp;&nbsp; The ID of the packet that contained the error, see
Remarks below.
<br>
<b>dwIndex</b>
<br>

&nbsp;&nbsp;The index number (starting at 1) of the first parameter that caused an error. Special case: <b>UNKNOWN_INDEX</b> = 0.</p>

<h4>Working Samples</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#CockpitCamera">Cockpit Camera </a></p>
      <p><a href="#TrackingErrors">Tracking Errors </a></p>
      <p><a href="#VariableStrings">Variable Strings </a></p></td>
  </tr>
</table>
<h4>Remarks</h4>

<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a>
structure and is returned when the <span style="font-weight: bold;">dwID</span>
parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span>
is set to
<span style="font-weight: bold;">SIMCONNECT_RECV_ID_EXCEPTION</span></span>.</p>

<p></p>

<p>In order to match the <span style="font-weight: bold;">dwSendID</span>
parameter returned here, with the ID of a request, use the <a href="#SimConnect_GetLastSentPacketID"><span style="font-weight: bold;">SimConnect_GetLastSentPacketID</span></a>
call after each request is made. </p>

<p></p>

Note that the HRESULT errors returned after each API call do not
involve any communication with the SimConnect server, but are simply
client-side errors that are returned immediately. Test
for&nbsp;exceptions to check for server-side
errors.
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>
  <li><a href="#SIMCONNECT_RECV_EVENT"><b>SIMCONNECT_RECV_EVENT</b></a></li>

  <li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>

  <li><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a></li>

  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>

<br>

<hr><br>

<a name="SIMCONNECT_RECV_ID"></a>
<h3>SIMCONNECT_RECV_ID</h3>

<p>The <b>SIMCONNECT_RECV_ID</b> enumeration type is
used within <span style="font-family: &quot;Times New Roman&quot;;">the
<a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a>
structure</span> to indicate which type of structure has been
returned.</p>

<h4>Syntax</h4>

<code><b>enum SIMCONNECT_RECV_ID{</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_NULL</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_EXCEPTION</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_OPEN</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_QUIT</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_EVENT</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_EVENT_FILENAME</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_EVENT_FRAME</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_SIMOBJECT_DATA</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_CLOUD_STATE,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_WEATHER_OBSERVATION,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_ASSIGNED_OJBECT_ID,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_RESERVED_KEY,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_CUSTOM_ACTION,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_SYSTEM_STATE,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_RECV_ID_CLIENT_DATA,</b><br>
<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>SIMCONNECT_RECV_ID_NULL</b><br>

&nbsp;&nbsp;Specifies that nothing useful has been returned.</p>
<p><br>

  <b>SIMCONNECT_RECV_ID_EXCEPTION</b><br>
&nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EXCEPTION">SIMCONNECT_RECV_EXCEPTION</a> structure has been received. </p>
<p><br>

 <b>SIMCONNECT_RECV_ID_OPEN</b><br>
&nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_OPEN">SIMCONNECT_RECV_OPEN</a> structure has been received. </p>
<p><br>

  <b>SIMCONNECT_RECV_ID_QUIT</b><br>
&nbsp;&nbsp;Specifies that the user has exited from <i>Flight
Simulator</i>. </p>
<p><br>

  <b>SIMCONNECT_RECV_ID_EVENT</b><br>
&nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a> structure has been received. </p>
<p><br>

 <b>SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE</b><br>
&nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE">SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE</a> structure has been received. </p>
<p><br>

  <b>SIMCONNECT_RECV_ID_EVENT_FILENAME</b><br>
&nbsp;&nbsp;Specifies that a&nbsp; <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT_FILENAME">SIMCONNECT_RECV_EVENT_FILENAME</a> structure has been received. </p>
<p><br>

  <b>SIMCONNECT_RECV_ID_EVENT_FRAME</b><br>
&nbsp;&nbsp;Specifies that a&nbsp; <a style="font-weight: bold;" href="#SIMCONNECT_RECV_EVENT_FRAME">SIMCONNECT_RECV_EVENT_FRAME</a> structure has been received. </p>
<p><br>

  <b>SIMCONNECT_RECV_ID_SIMOBJECT_DATA</b><br>
&nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_SIMOBJECT_DATA">SIMCONNECT_RECV_SIMOBJECT_DATA</a> structrure has been received. </p>
<p><br>

  <b>SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE</b><br>
&nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE">SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</a> structure has been received. </p>
<p><br>

  <b>SIMCONNECT_RECV_ID_WEATHER_OBSERVATION</b><br>
&nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_WEATHER_OBSERVATION">SIMCONNECT_RECV_WEATHER_OBSERVATION</a> structure has been received. </p>
<p>&nbsp;</p>
<p><b>SIMCONNECT_RECV_ID_CLOUD_STATE</b><br>
&nbsp;&nbsp;Specifies that a <b><a href="#SIMCONNECT_RECV_CLOUD_STATE">SIMCONNECT_RECV_CLOUD_STATE</a></b> structure has been received. </p>
<p>&nbsp;</p>
<p><b>SIMCONNECT_RECV_ID_ASSIGNED_OJBECT_ID</b><br>
  &nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_ASSIGNED_OBJECT_ID">SIMCONNECT_RECV_ASSIGNED_OBJECT_ID</a> structure has been received. </p><br>
  
  <p><b>SIMCONNECT_RECV_ID_RESERVED_KEY</b><br>
  &nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_RESERVED_KEY">SIMCONNECT_RECV_RESERVED_KEY</a> structure has been received. </p><br>
  
  <p><b>SIMCONNECT_RECV_ID_CUSTOM_ACTION</b><br>
  &nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_CUSTOM_ACTION">SIMCONNECT_RECV_CUSTOM_ACTION</a> structure has been received. </p><BR>
    
	<p><b>SIMCONNECT_RECV_ID_SYSTEM_STATE</b><br>
  &nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_SYSTEM_STATE">SIMCONNECT_RECV_SYSTEM_STATE</a> structure has been received. </p><BR>
  
	<p><b>SIMCONNECT_RECV_ID_CLIENT_DATA</b><br>
  &nbsp;&nbsp;Specifies that a <a style="font-weight: bold;" href="#SIMCONNECT_RECV_CLIENT_DATA">SIMCONNECT_RECV_CLIENT_DATA</a> structure has been received. </p><BR>


<h4>Working Samples</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#ClientEvent">Client Event</a></p>
        <p><a href="#NoCallback">No Callback </a></p>
      <p><a href="#TrackingErrors">Tracking Errors </a></p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td>All but a few of the other <a href="#WorkingSamples">samples</a> implement this enumeration. </td>
  </tr>
</table>
<h4>Remarks</h4>

<p class="style1">Typically a <a href="#DispatchProc"><b>DispatchProc</b></a> or <b><a href="#SimConnect_GetNextDispatch">SimConnect_GetNextDispatch</a></b> implementation of a client will include a case statement for each of the above members that the client might receive. </p>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>
  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>

<br>

<hr><br>

<a name="SIMCONNECT_RECV_SIMOBJECT_DATA"></a>
<h3>SIMCONNECT_RECV_SIMOBJECT_DATA</h3>

<p>The <b>SIMCONNECT_RECV_SIMOBJECT_DATA</b> structure
will be received by the client after a successful call to&nbsp;<a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a> or <a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>.</p>

<h4>Syntax</h4>

<p><code><b>struct SIMCONNECT_RECV_SIMOBJECT_DATA : public SIMCONNECT_RECV {</b><br>
  &nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwRequestID</b><b>;</b><br>
  &nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwObjectID</b><b>;</b><br>
  &nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwDefineID</b><b>;</b><br>
&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwFlags</b><b>;</b></code><code><br>
&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwentrynumber</b><b>;</b><br>
&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwoutof</b><b>;</b><br>
&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwDefineCount</b><b>;</b><br>
&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwData</b><b>;</b><br>
  
  <b>};</b><br>
</code></p>
<h4>Members</h4>

<p><b>dwRequestID</b><br>

&nbsp; The ID of the client defined request.
<br>

<b>dwDefineID</b><br>

&nbsp; The ID of the client defined data definition.
<br>

<b>dwFlags</b><br>

&nbsp; The flags that were set for this data request, see <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a> for a description of the flags. This parameter will always be set to zero if the call was <a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>.</p>
<p><b>dwentrynumber</b><br>
&nbsp;&nbsp; If multiple objects are being returned, this is
the index number of this object out of a total of <span style="font-weight: bold;">dwoutof</span>. This will always be 1 if the call was <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a>, and can be 0 or more if the call was&nbsp;<a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>.<br>
<b>dwoutof</b><br>
&nbsp;&nbsp; The total number of objects being returned. Note
that <span style="font-weight: bold;">dwentrynumber</span> and <span style="font-weight: bold;">dwoutof</span> start with 1 not 0, so if two objects are being
&nbsp;returned&nbsp;<span style="font-weight: bold;">dwentrynumber</span> and <span style="font-weight: bold;">dwoutof</span> pairs will be 1,2 and 2,2 for the two objects. This will always be 1 if the call was <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a>, and can be 0 or more if the call was&nbsp;<a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>.<br>

  <b>dwDefineCount</b><br>
&nbsp;&nbsp; The number of 8-byte elements in the <span style="font-weight: bold;">dwData</span> array.<br>

<b>dwData</b><br>
&nbsp;&nbsp; A data array&nbsp;containing information on a
specified object in
8-byte (double word) elements. The length of the array is
<span style="font-weight: bold;">dwDefineCount</span>. </p>
<h4>Working Samples</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#RequestData">Request Data </a></p>
      <p><a href="#SetData">Set Data</a></p>
      <p><a href="#TaggedData">Tagged Data </a></p>
      <p><a href="#ThrottleControl">Throttle Control</a></p>
        <p><a href="#VariableStrings">Variable Strings</a></p>    </td>
  </tr>
</table>
<h4>Remarks</h4>

<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a>
structure and is returned when the <span style="font-weight: bold;">dwID</span>
parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span>
is set to
<span style="font-weight: bold;">SIMCONNECT_RECV_ID_SIMOBJECT_DATA</span></span>.</p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>
  <li><a href="#SIMCONNECT_RECV_EVENT"><b>SIMCONNECT_RECV_EVENT</b></a></li>

  <li><a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a></li>

  <li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>

  <li><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE"><b>SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</b></a></li>

  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>

<br>

<hr><br>

<a name="SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE"></a>
<h3>SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</h3>

<p>The <b>SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</b>
structure will be received by the client after a successful call
to&nbsp;<a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>. It is an identical structure to <a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a>.</p>

<h4>Syntax</h4>

<code><b>struct SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE : public
SIMCONNECT_RECV_SIMBOBJECT_DATA{</b><br>
<b>};</b><br>
</code>
<h4>Remarks</h4>

<p><span style="font-family: &quot;Times New Roman&quot;;">This
  structure inherits the <a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a><a style="font-weight: bold;" href="#SIMCONNECT_RECV"></a>
  structure and is returned when the <span style="font-weight: bold;">dwID</span>
  parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span>
  is set to
<span style="font-weight: bold;">SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE</span>.<span style="text-decoration: underline;"><span style="font-weight: bold;"></span></span></span></p>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>
  <li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>

  <li><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a></li>

  <li><a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a></li>
  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>
<BR><HR><BR>
<A NAME="SIMCONNECT_RECV_OPEN"></A><H3>SIMCONNECT_RECV_OPEN</H3>
<p>The <B>SIMCONNECT_RECV_OPEN</B> structure is used to return information to the client, after a successful call to <a href="#SimConnect_Open"><b>SimConnect_Open</b></a>.</p>
<H4>Syntax</H4>
<CODE><B>struct SIMCONNECT_RECV_OPEN : public SIMCONNECT_RECV {</B><BR>
&nbsp;&nbsp;<B>char&nbsp;&nbsp;szApplicationName[256]</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwApplicationVersionMajor</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwApplicationVersionMinor</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwApplicationBuildMajor</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwApplicationBuildMinor</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwSimConnectVersionMajor</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwSimConnectVersionMinor</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwSimConnectBuildMajor</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwSimConnectBuildMinor</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwReserved1</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwReserved2</B><B>;</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>szApplicationName[256]</B><BR>
&nbsp;&nbsp;Null-terminated string containing the application name.<BR>
<B>dwApplicationVersionMajor</B><BR>
&nbsp;&nbsp;Double word containing the application version major number.
<BR>
<B>dwApplicationVersionMinor</B><BR>
&nbsp;&nbsp;Double word containing the application version minor number.
<BR>
<B>dwApplicationBuildMajor</B><BR>
&nbsp;&nbsp;Double word containing the application build major number.
<BR>
<B>dwApplicationBuildMinor</B><BR>
&nbsp;&nbsp;Double word containing the application build minor number.
<BR>
<B>dwSimConnectVersionMajor</B><BR>
&nbsp;&nbsp;Double word containing the SimConnect version major number.
<BR>
<B>dwSimConnectVersionMinor</B><BR>
&nbsp;&nbsp;Double word containing the SimConnect version minor number.
<BR>
<B>dwSimConnectBuildMajor</B><BR>
&nbsp;&nbsp;Double word containing theSimConnect build major number.
<BR><B>dwSimConnectBuildMinor</B><BR>
&nbsp;&nbsp;Double word containing the SimConnect build minor number.
<BR><B>dwReserved1</B><BR>
&nbsp;&nbsp;Reserved.
<BR><B>dwReserved2</B><BR>
&nbsp;&nbsp;Reserved.</p>

<H4>Remarks</H4>
<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a> structure and is returned when the <span style="font-weight: bold;">dwID</span> parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span> is set to <span style="font-weight: bold;">SIMCONNECT_RECV_ID_OPEN</span></span>. </p>
<H4>See Also</H4>
<UL type="disc"><li><a href="#SimConnect_API_Reference"><b>SimConnect
  API Reference </b></a></li>
<li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>
<li><a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a></li>
<li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>
<li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
  Structures
  and Enumerations</b></a></li>
</UL>
<BR><HR><BR>
<A NAME="SIMCONNECT_RECV_RESERVED_KEY"></A><H3>SIMCONNECT_RECV_RESERVED_KEY</H3>
<p>The <B>SIMCONNECT_RECV_RESERVED_KEY</B> structure is used with the <A HREF="#SimConnect_RequestReservedKey"><B>SimConnect_RequestReservedKey</B></A> function to return the reserved key combination.</p>
<H4>Syntax</H4>
<CODE><B>struct SIMCONNECT_RECV_RESERVED_KEY : public SIMCONNECT_RECV {</B><BR>
&nbsp;&nbsp;<B>char&nbsp;&nbsp;szChoiceReserved[30]</B><B>;</B><BR>
&nbsp;&nbsp;<B>char&nbsp;&nbsp;szReservedKey[50]</B><B>;</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>szChoiceReserved[30]</B><BR>
&nbsp;&nbsp;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  <A HREF="#SimConnect_RequestReservedKey"><B>SimConnect_RequestReservedKey</B></A> function.<BR>
<B>szReservedKey[50]</B><BR>
&nbsp;&nbsp;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 &quot;q&quot;, and the choice is accepted, then this parameter will contain &quot;TAB+Q&quot;. If the client program requests &quot;Q&quot;, then this parameter will contain &quot;SHIFT+TAB+Q&quot;. This string could then appear, for example, in a dialog from the client application, informing a user of the appropriate help key. </p>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><p><a href="#ReservedKey">Reserved Key</a></p>    </td>
  </tr>
</table>
<H4>Remarks</H4>
<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a> structure and is returned when the <span style="font-weight: bold;">dwID</span> parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span> is set to <span style="font-weight: bold;">SIMCONNECT_RECV_ID_RESERVED_KEY</span></span>.</p>
<H4>See Also</H4>
<UL type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect
    API Reference </b></a></li>
  <li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>
  <li><a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a></li>
  <li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>
  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
    Structures
    and Enumerations</b></a></li>
</UL>
<br>

<hr><br>

<A NAME="SIMCONNECT_RECV_SYSTEM_STATE"><H3>SIMCONNECT_RECV_SYSTEM_STATE</H3></A>
<p><BR>
The <B>SIMCONNECT_RECV_SYSTEM_STATE</B> structure is used with the <b><a href="#SimConnect_RequestSystemState">SimConnect_RequestSystemState</a></b> function to retrieve specific <i>Flight Simulator</i> systems states and information.</p>
<H4>Syntax</H4>
<CODE><B>typedef struct SIMCONNECT_RECV_SYSTEM_STATE : public SIMCONNECT_RECV {</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwRequestID</B><B>;</B><BR>
&nbsp;&nbsp;<B>DWORD&nbsp;&nbsp;dwInteger</B><B>;</B><BR>
&nbsp;&nbsp;<B>float&nbsp;&nbsp;fFloat</B><B>;</B><BR>
&nbsp;&nbsp;<B>char&nbsp;&nbsp; szString[MAX_PATH]</B><B>;</B><BR>
<B>};</B></CODE><BR>
<CODE><BR>
</CODE><H4>Members</H4>
<B>dwRequestID</B><BR>
&nbsp;&nbsp;Double word containing the client defined request ID.<BR>
<B>dwInteger</B><BR>
&nbsp;&nbsp;Double word containing an integer, or boolean, value.<BR>
<B>fFloat</B><BR>
&nbsp;&nbsp;A float value.<BR>
<B>szString</B><BR>
&nbsp;&nbsp;Null-terminated string.<BR>
<H4>Remarks</H4>
<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a> structure and is returned when the <span style="font-weight: bold;">dwID</span> parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span> is set to <span style="font-weight: bold;">SIMCONNECT_RECV_ID_SYSTEM_STATE</span></span>.</p>
<p>&nbsp;</p>
<p>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 <b><a href="#SimConnect_SetSystemState">SimConnect_SetSystemState</a></b> and <b><a href="#SimConnect_RequestSystemState">SimConnect_RequestSystemState</a></b> functions.</p>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>

  <li><a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a></li>

  <li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>

   <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>

<br><HR><BR>
<a name="SIMCONNECT_RECV_WEATHER_OBSERVATION"></a>
<h3>SIMCONNECT_RECV_WEATHER_OBSERVATION</h3>

<p>The <b>SIMCONNECT_RECV_WEATHER_OBSERVATION</b>
structure is used to return weather observation data, after calls to one of: <a href="#SimConnect_WeatherRequestInterpolatedObservation"><b>SimConnect_WeatherRequestInterpolatedObservation</b></a>, <a href="#SimConnect_WeatherRequestObservationAtStation"><b>SimConnect_WeatherRequestObservationAtStation</b></a>, or <a href="#SimConnect_WeatherRequestObservationAtNearestStation"><b>SimConnect_WeatherRequestObservationAtNearestStation</b></a></p>

<h4>Syntax</h4>

<code><b>struct SIMCONNECT_RECV_WEATHER_OBSERVATION : public SIMCONNECT_RECV {</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwRequestID</b><b>;</b><br>

&nbsp;&nbsp;<b>char&nbsp;&nbsp;szMETAR[1]</b><b>;</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>dwRequestID</b><br>

&nbsp; The ID of the client defined request.<br>

<b>szMETAR[1]</b><br>

&nbsp;&nbsp;Null-terminated string containing the Metar weather
data. The maximum length of this string is 2000 chars.
See the section <a href="#Metar_Data_Format">Metar Data Format</a> for details on the format required.</p>

<h4>Working Sample</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><a href="#WeatherStation">Weather Station </a></td>
  </tr>
</table>
<h4>Remarks</h4>

<p><span style="font-family: &quot;Times New Roman&quot;;">This
structure inherits the <a style="font-weight: bold;" href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a> structure and is returned when the <span style="font-weight: bold;">dwID</span> parameter of <span style="font-weight: bold;">SIMCONNECT_RECV</span> is set to <span style="font-weight: bold;">SIMCONNECT_RECV_ID_WEATHER_OBSERVATION</span>.<span style="text-decoration: underline;"><span style="font-weight: bold;"></span></span></span></p>

<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference</b></a></li>

  <li><b><a href="#SIMCONNECT_RECV_CLOUD_STATE">SIMCONNECT_RECV_CLOUD_STATE</a></b></li>
  <li><a href="#SIMCONNECT_RECV"><b>SIMCONNECT_RECV</b></a></li>
  <li><a href="#SIMCONNECT_RECV_EVENT"><b>SIMCONNECT_RECV_EVENT</b></a></li>

  <li><a href="#SIMCONNECT_RECV_EXCEPTION"><b>SIMCONNECT_RECV_EXCEPTION</b></a></li>

  <li><a href="#SIMCONNECT_RECV_ID"><b>SIMCONNECT_RECV_ID</b></a></li>

  <li><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA"><b>SIMCONNECT_RECV_SIMOBJECT_DATA</b></a></li>

  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>

<br>

<hr><br>

<a name="SIMCONNECT_SIMOBJECT_TYPE"></a>
<h3>SIMCONNECT_SIMOBJECT_TYPE</h3>

<p>The <b>SIMCONNECT_SIMOBJECT_TYPE</b> enumeration
type is used with the <a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a>
call to request information on specific or nearby objects.</p>

<h4>Syntax</h4>

<code><b>enum SIMCONNECT_SIMOBJECT_TYPE{</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_SIMOBJECT_TYPE_USER</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_SIMOBJECT_TYPE_ALL</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_SIMOBJECT_TYPE_BOAT</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_SIMOBJECT_TYPE_GROUND</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>SIMCONNECT_SIMOBJECT_TYPE_USER</b><br>

&nbsp;&nbsp;Specifies the user's aircraft.</p>
<p><br>

  <b>SIMCONNECT_SIMOBJECT_TYPE_ALL</b><br>
&nbsp;&nbsp;Specifies all&nbsp;AI controlled objects.</p>
<p><br>

  <b>SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT</b><br>
&nbsp;&nbsp;Specifies all&nbsp;aircraft.</p>
<p><br>

  <b>SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER</b><br>
&nbsp;&nbsp;Specifies all helicopters.</p>
<p><br>

  <b>SIMCONNECT_SIMOBJECT_TYPE_BOAT</b><br>
&nbsp;&nbsp;Specifies all AI controlled boats.</p>
<p><br>

  <b>SIMCONNECT_SIMOBJECT_TYPE_GROUND</b><br>
&nbsp;&nbsp;Specifies all AI controlled ground vehicles. </p>
<h4>Working Samples</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#RequestData">Request Data </a></p>
        <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td><p><a href="#SetData">Set Data </a></p>
        <p><a href="#TaggedData">Tagged Data</a></p>
      <p><a href="#ThrottleControl">Throttle Contol</a></p></td>
  </tr>
</table>
<p>&nbsp;</p>

<h4>Remarks</h4>

<p>This
enum 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 <i>Flight Simulator</i> itself. It can also be used to specificy 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 controlled
by the AI component.</p>
<p>&nbsp;</p>
<p>See the remarks and examples for &nbsp;<a href="#SimConnect_AddToDataDefinition"><b>SimConnect_AddToDataDefinition</b></a>.</p>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a style="font-weight: bold;" href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a></li>
  <li><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE"><b>SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</b></a></li>

  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>

<br>

<hr><br>

<a name="SIMCONNECT_STATE"></a>
<h3>SIMCONNECT_STATE</h3>

<p>The <b>SIMCONNECT_STATE</b> enumeration type is
used with the&nbsp;<a style="font-weight: bold;" href="#SimConnect_SetSystemEventState">SimConnect_SetSystemEventState</a>
call to turn the reporting of events on and off.</p>

<h4>Syntax</h4>

<code><b>enum SIMCONNECT_STATE{</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_STATE_OFF</b><b>,</b><br>

&nbsp;&nbsp;<b>SIMCONNECT_STATE_ON</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>SIMCONNECT_STATE_OFF</b><br>

&nbsp;&nbsp;Specifies off.</p>
<p><br>

  <b>SIMCONNECT_STATE_ON</b><br>
&nbsp;&nbsp;Specifies on.</p>
<h4>Working Samples</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples </h5></td>
    <td><p><a href="#CockpitCamera">Cockpit Camera</a></p>
        <p><a href="#InputEvent">Input Event </a></p>
      <p><a href="#JoystickInput">Joystick Input</a></p>
      <p><a href="#ThrottleControl">Throttle Control</a></p></td>
  </tr>
  <tr>
    <td><h5>Reference samples </h5></td>
    <td><a href="#SetData">Set Data</a></td>
  </tr>
</table>
<p>&nbsp;</p>

<h4>Remarks</h4>

<p>See the remarks for <a style="font-weight: bold;" href="#SimConnect_MapInputEventToClientEvent">SimConnect_MapInputEventToClientEvent</a>.</p>

<h4>See Also</h4>

<ul type="disc">

  <li style="font-weight: bold;"><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference </b></a></li>

  <li><a href="#SimConnect_SetSystemEventState"><b>SimConnect_SetSystemEventState</b></a></li>
  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>

<br>

<hr><br>

<a name="SIMCONNECT_DATA_INITPOSITION"></a>
<h3>SIMCONNECT_DATA_INITPOSITION</h3>

<p>The <b>SIMCONNECT_DATA_INITPOSITION</b>
structure is used to initialize the position of the user aircraft, AI controlled aircraft, or other simulation object. </p>

<h4>Syntax</h4>

<code><b>struct SIMCONNECT_DATA_INITPOSITION{</b><br>

&nbsp;&nbsp;<b>double&nbsp;&nbsp;Latitude</b><b>;</b><br>

&nbsp;&nbsp;<b>double&nbsp;&nbsp;Longitude</b><b>;</b><br>

&nbsp;&nbsp;<b>double&nbsp;&nbsp;Altitude</b><b>;</b><br>

&nbsp;&nbsp;<b>double&nbsp;&nbsp;Pitch</b><b>;</b><br>

&nbsp;&nbsp;<b>double&nbsp;&nbsp;Bank</b><b>;</b><br>

&nbsp;&nbsp;<b>double&nbsp;&nbsp;Heading</b><b>;</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;OnGround</b><b>;</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;Airspeed</b><b>;</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>Latitude</b><br>

&nbsp;&nbsp; Latitude in degrees.
<br>

<b>Longitude</b><br>

&nbsp;&nbsp; Longitude in degrees.
<br>

<b>Altitude</b><br>

&nbsp;&nbsp; Altitude in feet.
<br>

<b>Pitch</b><br>

&nbsp;&nbsp; Pitch in degrees.
<br>

<b>Bank</b><br>

&nbsp;&nbsp; Bank in degrees.
<br>

<b>Heading</b><br>

&nbsp;&nbsp; Heading in degrees.
<br>

<b>OnGround</b><br>

&nbsp;&nbsp; Set this to 1 to place the object on the ground, or 0 if the object is to be airborne. <br>

<b>Airspeed</b><br>

&nbsp;&nbsp;The airspeed in knots, or one of the following special values:</p>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Define</h5></td>
    <td><h5>Value</h5></td>
    <td><h5>Description</h5></td>
  </tr>
  <tr>
    <td><b>INITPOSITION_AIRSPEED_CRUISE</b></td>
    <td>-1</td>
    <td>The aircraft's design cruising speed. </td>
  </tr>
  <tr>
    <td><b>INITPOSITION_AIRSPEED_KEEP</b></td>
    <td>-2</td>
    <td>Maintain the current airspeed. </td>
  </tr>
</table>
<p>&nbsp; </p>
<h4>Working Samples</h4>

<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary samples</h5></td>
    <td><p><a href="#AIObjectsandWaypoints">AI Objects and Waypoints</a></p>
    <p><a href="#SetData">Set Data </a></p></td>
  </tr>
</table>
<h4>Remarks</h4>

<p>The primary use of this structure is to <i>initialize</i> the positioning of the user aircraft, because it also optimizes some of the terrain systems and other<i> Flight Simulator</i> 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 <a href="../Variables/Simulation Variables.html">Simulation Variables</a> document). </p>
<p>&nbsp;</p>
<p>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.</p>
<p>&nbsp; </p>
<p>This structure is used by the functions: <A HREF="#SimConnect_AICreateNonATCAircraft"><B>SimConnect_AICreateNonATCAircraft</B></A>, <A HREF="#SimConnect_AICreateSimulatedObject"><B>SimConnect_AICreateSimulatedObject</B></A> and <a href="#SimConnect_AddToDataDefinition"><b>SimConnect_AddToDataDefinition</b></a>.</p>
<p>&nbsp;</p>
<p>This structure can only be used to set data, it cannot be used as part of a data request. </p>
<h4>See Also</h4>

<ul type="disc">
  <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference</b></a></li>
  <li><a style="font-weight: bold;" href="#SIMCONNECT_DATATYPE">SIMCONNECT_DATATYPE</a></li>
  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect Structures and Enumerations</b></a> </li>
</ul>

<br>

<hr><br>


<A NAME="SIMCONNECT_DATA_LATLONALT"></A><H3>SIMCONNECT_DATA_LATLONALT</H3>
<p>The <B>SIMCONNECT_DATA_LATLONALT</B> structure is used to hold a world position.</p>
<H4>Syntax</H4>
<CODE><B>struct SIMCONNECT_DATA_LATLONALT{</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;Latitude</B><B>;</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;Longitude</B><B>;</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;Altitude</B><B>;</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>Latitude</B><BR>
&nbsp;&nbsp;   The latitude of the position in degrees.
<BR>
<B>Longitude</B><BR>
&nbsp;&nbsp;   The longitude of the position in degrees.
<BR>
<B>Altitude</B><BR>
&nbsp;&nbsp;   The altitude of the position in feet.
<BR>
</p>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td>&nbsp;</td>
  </tr>
</table>
<H4>Remarks</H4>
<p>This structure is used when one of the following simulation variables is requested (with a call to <a href="#SimConnect_RequestDataOnSimObject"><b>SimConnect_RequestDataOnSimObject</b></a>):</p>
<ul>
  <li>ADF LATLONALT</li>
  <li>    NAV DME LATLONALT</li>
  <li>    NAV GS LATLONALT</li>
  <li>    NAV VOR LATLONALT</li>
  <li>INNER MARKER LATLONALT</li>
  <li>MIDDLE MARKER LATLONALT</li>
  <li>OUTER MARKER LATLONALT</li>
</ul>
<H4>See Also</H4>
<UL type="disc">
 <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference</b></a></li>
 <li><a style="font-weight: bold;" href="#SIMCONNECT_DATATYPE">SIMCONNECT_DATATYPE</a></li>
 <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect Structures and Enumerations</b></a> </li>
<BR><HR><BR>

<h3><a name="SIMCONNECT_DATA_MARKERSTATE"></a>SIMCONNECT_DATA_MARKERSTATE</h3>

<p>The <b>SIMCONNECT_DATA_MARKERSTATE</b>
structure is used to help graphically link flight model data with the graphics model.</p>

<h4>Syntax</h4>

<code><b>struct SIMCONNECT_DATA_MARKERSTATE{</b><br>

&nbsp;&nbsp;<b>char&nbsp;&nbsp;szMarkerName[64]</b><b>;</b><br>

&nbsp;&nbsp;<b>DWORD&nbsp;&nbsp;dwMarkerState</b><b>;</b><br>

<b>};</b><br>

<br>
</code>
<h4>Members</h4>

<p><b>szMarkerName[64]</b><br>

&nbsp;&nbsp;Null-terminated string containing the marker
name. One from the following table:</p>
<p>&nbsp;</p>
<table class="T1" width="200" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>String</h5></td>
  </tr>
  <tr>
    <td><b> Cg</b></td>
  </tr>
  <tr>
    <td><b> ModelCenter </b></td>
  </tr>
  <tr>
    <td><b> Wheel </b></td>
  </tr>
  <tr>
    <td><b> Skid </b></td>
  </tr>
  <tr>
    <td><b> Ski </b></td>
  </tr>
  <tr>
    <td><b> Float </b></td>
  </tr>
  <tr>
    <td><b> Scrape </b></td>
  </tr>
  <tr>
    <td><b> Engine </b></td>
  </tr>
  <tr>
    <td><b> Prop </b></td>
  </tr>
  <tr>
    <td><b> Eyepoint </b></td>
  </tr>
  <tr>
    <td><b> LongScale </b></td>
  </tr>
  <tr>
    <td><b> LatScale </b></td>
  </tr>
  <tr>
    <td><b> VertScale </b></td>
  </tr>
  <tr>
    <td><b> AeroCenter </b></td>
  </tr>
  <tr>
    <td><b> WingApex </b></td>
  </tr>
  <tr>
    <td><b> RefChord </b></td>
  </tr>
  <tr>
    <td><b> Datum </b></td>
  </tr>
  <tr>
    <td><b> WingTip </b></td>
  </tr>
  <tr>
    <td><b> FuelTank </b></td>
  </tr>
  <tr>
    <td><b> Forces </b></td>
  </tr>
</table>
<p>&nbsp;</p>
<p> <br>
  
  <b>dwMarkerState</b><br>
  &nbsp;&nbsp;Double word containing the marker state, set to 1 for on and 0 for off. </p>


<h4>Remarks</h4>

<p>The <a style="font-weight: bold;" href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a> call can be used to add a <b>SIMCONNECT_DATA_MARKERSTATE</b> 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. </p>
<p>&nbsp;</p>
<p>This structure can only be used as input,  it cannot be used as part of a data request.</p>
<h4>See Also</h4>

<ul type="disc">

  <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference</b></a></li>

  <li><a style="font-weight: bold;" href="#SIMCONNECT_DATATYPE">SIMCONNECT_DATATYPE</a></li>
  <li><a href="#SIMCONNECT_DATA_INITPOSITION"><b>SIMCONNECT_DATA_INITPOSITION</b></a></li>
  <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</ul>
<BR><HR><BR>
<A NAME="SIMCONNECT_DATA_WAYPOINT"></A><H3>SIMCONNECT_DATA_WAYPOINT</H3>
<p>The <B>SIMCONNECT_DATA_WAYPOINT</B> structure is used to hold all the necessary information on a waypoint.</p>
<H4>Syntax</H4>
<CODE><B>struct SIMCONNECT_DATA_WAYPOINT{</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;Latitude</B><B>;</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;Longitude</B><B>;</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;Altitude</B><B>;</B><BR>
&nbsp;&nbsp;<B>unsigned long&nbsp;&nbsp;Flags</B><B>;</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;ktsSpeed</B><B>;</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;percentThrottle</B><B>;</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>Latitude</B><BR>
&nbsp;&nbsp;   The latitude of the waypoint in degrees.
<BR>
<B>Longitude</B><BR>
&nbsp;&nbsp;   The longitude of the waypoint in degrees.
<BR>
<B>Altitude</B><BR>
&nbsp;&nbsp;   The altitude of the waypoint in feet.
<BR>
<B>Flags</B><BR>
&nbsp;&nbsp;Specifies the flags set for this waypoint, see <b><a href="#SIMCONNECT_WAYPOINT_FLAGS">SIMCONNECT_WAYPOINT_FLAGS</a></b>.
These flags can be ORed together, for example:<br>
<CODE><B>Flags = SIMCONNECT_WAYPOINT_ON_GROUND</B></CODE> | <CODE><B>SIMCONNECT_WAYPOINT_REVERSE</B></CODE>;
<BR>
<B>ktsSpeed</B><BR>
&nbsp;&nbsp;   Specifies the required speed in knots. If a specific speed is required, then the <b>SIMCONNECT_WAYPOINT_SPEED_REQUESTED</b> flag must be set to <b>True</b>.
<BR>
<B>percentThrottle</B><BR>
&nbsp;&nbsp;Specifies the required throttle as a percentage. If a specific throttle percentage is required, then the <b>SIMCONNECT_THROTTLE_REQUESTED</b> flag must be set to <b>True</b>. </p>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><a href="#AIObjectsandWaypoints">AI Objects and Waypoints </a></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>The <a style="font-weight: bold;" href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a> call can be used to add a <B>SIMCONNECT_DATA_WAYPOINT </B>structure to a data definition. A list of waypoints is sent to an AI object using the <b><a href="#SimConnect_SetDataOnSimObject">SimConnect_SetDataOnSimObject</a></b> function. There is no limit to the number of waypoints that can be sent to an object. If just one waypoint is set, the <B>SIMCONNECT_WAYPOINT_WRAP_TO_FIRST</B> flag should not be used. </p>
<p>&nbsp;</p>
<p>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. </p>
<p>&nbsp;</p>
<p>This structure can only be used to set data, it cannot be used as part of a data request.</p>
<H4>See Also</H4>
<UL type="disc">
 <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference</b></a></li>
 <li><a style="font-weight: bold;" href="#SIMCONNECT_DATATYPE">SIMCONNECT_DATATYPE</a></li>
 <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect Structures and Enumerations</b></a> </li>
</UL>
<br>

<hr><br>

<A NAME="SIMCONNECT_DATA_XYZ"></A><H3>SIMCONNECT_DATA_XYZ</H3>
<p>The <B>SIMCONNECT_DATA_XYZ</B> structure is used to hold a 3D co-ordinate.</p>
<H4>Syntax</H4>
<CODE><B>struct SIMCONNECT_DATA_XYZ{</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;x</B><B>;</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;y</B><B>;</B><BR>
&nbsp;&nbsp;<B>double&nbsp;&nbsp;z</B><B>;</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p><B>x</B><BR>
&nbsp;&nbsp;   The position along the x axis.
<BR>
<B>y</B><BR>
&nbsp;&nbsp;   The position along the y axis.
<BR>
<B>z</B><BR>
&nbsp;&nbsp;   The position along the z axis.
<BR>
</p>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table width="500" border="1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td>&nbsp;</td>
  </tr>
</table>
<H4>Remarks</H4>
<p>&nbsp;</p>
<H4>See Also</H4>
<UL type="disc">
 <li><a href="#SimConnect_API_Reference"><b>SimConnect API Reference</b></a></li>
 <li><a style="font-weight: bold;" href="#SIMCONNECT_DATATYPE">SIMCONNECT_DATATYPE</a></li>
 <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect Structures and Enumerations</b></a> </li>

<BR><HR><BR>
<A NAME="SIMCONNECT_WAYPOINT_FLAGS"></A><H3>SIMCONNECT_WAYPOINT_FLAGS</H3>
<p>The <B>SIMCONNECT_WAYPOINT_FLAGS</B> enumeration type is used with the <b><a href="#SIMCONNECT_DATA_WAYPOINT">SIMCONNECT_DATA_WAYPOINT</a></b> structure to define waypoints.</p>
<H4>Syntax</H4>
<CODE><B>enum SIMCONNECT_WAYPOINT_FLAGS{</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_WAYPOINT_SPEED_REQUESTED = 0x04,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_WAYPOINT_THROTTLE_REQUESTED = 0x08,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_WAYPOINT_COMPUTE_VERTICAL_SPEED = 0x10,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_WAYPOINT_ALTITUDE_IS_AGL = 0x20,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_WAYPOINT_ON_GROUND = 0x00100000,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_WAYPOINT_REVERSE = 0x00200000,</B><BR>
&nbsp;&nbsp;<B>SIMCONNECT_WAYPOINT_WRAP_TO_FIRST = 0x00400000,</B><BR>
<B>};</B><BR>
<BR>
</CODE><H4>Members</H4>
<p>. <BR>
  <B>SIMCONNECT_WAYPOINT_SPEED_REQUESTED</B><BR>
&nbsp;&nbsp;Specifies requested speed is valid.</p>
<p>. <BR>
  <B>SIMCONNECT_WAYPOINT_THROTTLE_REQUESTED</B><BR>
&nbsp;&nbsp;Specifies requested throttle percentage is valid.</p>
<p>  <BR>
  <B>SIMCONNECT_WAYPOINT_COMPUTE_VERTICAL_SPEED</B><BR>
&nbsp;&nbsp;Specifies that the vertical should be calculated to reach the required speed when crossing the waypoint.</p>
<p><BR>
  <B>SIMCONNECT_WAYPOINT_ALTITUDE_IS_AGL</B><BR>
&nbsp;&nbsp;Specifies the altitude specified is AGL (above ground level).</p>
<p>  <BR>
  <B>SIMCONNECT_WAYPOINT_ON_GROUND</B><BR>
&nbsp;&nbsp;Specifies the waypoint should be on the ground. Make sure this flag is set if the aircraft is to taxi to this point. </p>
<p>  <BR>
  <B>SIMCONNECT_WAYPOINT_REVERSE</B><BR>
&nbsp;&nbsp;Specifies that the aircraft should back up to this waypoint. This is only valid on the first waypoint.</p>
<p>  <BR>
  <B>SIMCONNECT_WAYPOINT_WRAP_TO_FIRST</B><BR>
&nbsp;&nbsp;Specifies that the next waypoint is the first waypoint. This is only valid on the last waypoint.</p>
<H4>Working Sample</H4>
<p>&nbsp;</p>
<table class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Primary sample</h5></td>
    <td><a href="#AIObjectsandWaypoints">AI Objects and Waypoints </a></td>
  </tr>
</table>
<H4>Remarks</H4>
<p>To set multiple waypoint flags simply OR them together. See the remarks for the  <b><a href="#SIMCONNECT_DATA_WAYPOINT">SIMCONNECT_DATA_WAYPOINT</a></b> structure. </p>
<H4>See Also</H4>
<UL type="disc">
 <li><a href="#SimConnect_API_Reference"><b>SimConnect
API Reference</b></a></li>
 <li><a href="#SimConnect_Structures_and_Enumerations"><b>SimConnect
Structures
and Enumerations</b></a> </li>
</UL>
<BR><HR><BR>
<h2>Programming SimConnect Clients using C#<a name="ProgrammingSimConnectClientsusingCsharp"></a></h2>
<p>There is a managed wrapper for SimConnect that enables .NET language programmers to write SimConnect clients. This section describes how to set up a managed client project, and the key differences to look out for when programming to the wrapper. There are also a number of <a href="#Managedcodesamples">managed code samples</a> included with the SDK.</p>
<p>&nbsp;</p>
<h3>Setup for .NET</h3>
<ol>
  <li>
  <p>Ensure that Microsoft &reg; .NET Framework Version 2.0 is installed. If it is not, uninstall the <i>Flight Simulator X SDK</i>, install the .NET Framework from the following link, then re-install the SDK:<br> 
    <br>
  <a href = "
http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en"> http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&amp;displaylang=en</a>
  <br>
  </li>
  <li>Create a new project using Microsoft &reg; Visual Studio 2005, typically this would be a C# Windows Application. </li>
  <li>Add a new reference to <b>Microsoft.FlightSimulator.SimConnect</b> in your project. This file can be found in the <i>SDK\Core Utilities Kit\SimConnect SDK\lib\managed</i> folder. </li>
  <li>Add the following two lines to the projects' <i>using</i> statements:<br>
    <b>using Microsoft.FlightSimulator.SimConnect;<br>
  using System.Runtime.InteropServices; </b></li>
  <li>Write the application using the functions in the SimConnect library, taking into account the following notes.</li>
</ol>
<h3>Notes on .NET client programming</h3>
<ul>
  <li>The managed SimConnect assembly is installed in the GAC (global assembly cache) during the installation of the SimConnect SDK, so it should not be manually placed anywhere for your application to run. However, you do need to reference a copy of this dll in Microsoft &reg; Visual Studio so that it can resolve symbols at compile time. As Microsoft &reg; Visual Studio  does not support referencing an assembly stored in the GAC, a copy of the SimConnect.dll outside the simconnect SDK msi is shipped solely for this purpose.
  <br>  
  <li>The native function calls <b><a href="#SimConnect_Open">SimConnect_Open</a></b> and <b><a href="#SimConnect_Close">SimConnect_Close</a></b>   have been replaced by the <b>SimConnect</b> constructor, and <b>Dispose</b> method respectively. This means that there is no handle required for the function calls, so for the most part the managed calls use the same parameters as the native calls, except without the SimConnect handle. The code to open and close a SimConnect client is:<br>

    <p>&nbsp;</p>
    <table class="T1" width="662" cellspacing="2">
      <tr>
        <td><code>// <b>Open</b><br>// Declare a SimConnect object <br>
          SimConnect simconnect = null;<br>
          try<br>
          {<br>
          &nbsp;&nbsp;simconnect&nbsp;=&nbsp;new&nbsp;SimConnect(&quot;Managed&nbsp;Data&nbsp;Request&quot;,&nbsp;this.Handle,&nbsp;WM_USER_SIMCONNECT,&nbsp;null,&nbsp;0);<br>
          }<br>
          catch (COMException ex)<br>
          {<br>
          &nbsp;&nbsp;// A connection to the SimConnect server could not be established <br>
        }</code></td>
    </tr>
      <tr>
        <td><code>// <b>Close</b><br>if (simconnect != null)<br>
          {<br>
  &nbsp;&nbsp;simconnect.Dispose();<br>
  &nbsp;&nbsp;simconnect = null;<br>
        }<br></code></td>
    </tr>
    </table>
    <p>&nbsp;</p>
  <li>What would have been a failed   <b>HRESULT</b> returned in the native API  translates to a   <b>COMException</b>.</li>
  <li>The use of raw memory pointers is   not permitted in the managed API. You must define your structs and attribute   them properly so that the system marshaler can handle them. See the code in the <a href="#ManagedDataRequest">Managed Data Request</a> sample. </li>
  <li>When the client receives either a   <a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE"><b>SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</b></a> or a <b><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA">SIMCONNECT_RECV_SIMOBJECT_DATA</a></b> structure, the dwData[0] member will contain your struct as   System.Object. This should be cast  to the proper   type.</li>
  <li>Partial data return   (<b>SIMCONNECT_DATA_REQUEST_FLAG_TAGGED</b>) is   unsupported. For a description of this flag see the <b><a href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a></b> function. </li>
  <li>The top level <b>ReceiveDispatch</b>   switch case statement is not necessary. The client should register a handler for the   appropriate <i>OnRecvXXX</i> event, and call <b>ReceiveMessage</b> when it is  notified   that messages are waiting in the queue. For Windows applictions use a win32 handle (a Control.Handle) to SimConnect to receive notifications when a message   arrives. The code for this is as follows:<br> 
    <br>
    <table class"T1" cellspacing="2" cellpadding="4">
      <tr>
        <td> <code>protected override void DefWndProc(ref Message m)<br>
{<br>
&nbsp;&nbsp;if (m.Msg == WM_USER_SIMCONNECT)<br>
&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;if (simconnect != null)<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;simconnect.ReceiveMessage();<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;}<br>
&nbsp;&nbsp;else<br>
&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;base.DefWndProc(ref m);<br>
&nbsp;&nbsp;}<br>
}</code></td>
      </tr>
    </table>
  </li>
  <li>Constants in the native simconnect.h are declared as static   members of the SimConnect class. For example: <b>SIMCONNECT_OBJECT_ID_USER</b> becomes <b>SimConnect.SIMCONNECT_OBJECT_ID_USER</b></li>
  <li>Enums in C# are scoped. The names of the enum members have been changed, for example, <b><a href="#SIMCONNECT_RECV_ID">SIMCONNECT_RECV_ID_QUIT</a></b> in native code is <b>SIMCONNECT_RECV_ID.QUIT</b> in managed code. </li>
  <li>Structs are mostly unchanged, with the exception that   a char array is represented as a System.String. However, they do need to be registered with the managed wrapper with a call to <b>RegisterDataDefineStruct</b>. If a string is too long during   the data marshaling, it will get truncated   safely. Some specific information must be provided with each structure, as shown in bold in the example below (also refer to the <a href="#ManagedDataRequest">Managed Data Request</a> sample): <br> 
    <br>
      <table class="T1" cellspacing="2" cellpadding="4">
        <tr>
          <td><p><code>
            <b>[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]</b><br>
            struct Struct1<br>
            {<br>
  &nbsp;&nbsp;// this is how you declare a fixed size string<br>
  &nbsp;&nbsp;<b>[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]</b><br>
  &nbsp;&nbsp;public String title;<br>
  &nbsp;&nbsp;public double latitude;<br>
  &nbsp;&nbsp;public double longitude;<br>
  &nbsp;&nbsp;public double altitude;<br>
            <br>
            };<br>
			<br>
           // define the data structure<br>
		   //&nbsp;Note&nbsp;that&nbsp;the&nbsp;DATATYPE.STRING256&nbsp;matches&nbsp;the&nbsp;SizeConst&nbsp;256&nbsp;in&nbsp;the&nbsp;MarshalAs&nbsp;statement&nbsp;above<br>
		   //<br>
simconnect.AddToDataDefinition((uint)DEFINITIONS.Struct1,&nbsp;&quot;Title&quot;,&nbsp;null,&nbsp;SIMCONNECT_DATATYPE.STRING256,&nbsp;0);&nbsp;<br>
simconnect.AddToDataDefinition((uint)DEFINITIONS.Struct1,&nbsp;&quot;Plane&nbsp;Latitude&quot;,&nbsp;&quot;degrees&quot;,&nbsp;SIMCONNECT_DATATYPE.FLOAT64,&nbsp;0);<br>
simconnect.AddToDataDefinition((uint)DEFINITIONS.Struct1,&nbsp;&quot;Plane&nbsp;Longitude&quot;,&nbsp;&quot;degrees&quot;,&nbsp;SIMCONNECT_DATATYPE.FLOAT64,&nbsp;0);<br>
simconnect.AddToDataDefinition((uint)DEFINITIONS.Struct1,&nbsp;&quot;Plane&nbsp;Altitude&quot;,&nbsp;&quot;feet&quot;,&nbsp;SIMCONNECT_DATATYPE.FLOAT64,&nbsp;0);<br>
//<br>
          // IMPORTANT: register it with the simconnect managed wrapper marshaller<br>
          // if you skip this step, you will only receive a uint in the .dwData field.<br>
		  //<br>
          <b>simconnect.RegisterDataDefineStruct&lt;Struct1&gt;((uint)DEFINITIONS.Struct1);</b><br></code></td>
        </tr>
      </table>
  </li>
  <li>Variable length strings are not supported in the managed layer.  </li>
</ul>
<HR>
<h2>Working Samples<a name="WorkingSamples"></a></h2>
<p>Click on the Working Sample column to display the source file of a working sample. Many of the samples include the use of functions not listed in the Highlighted Functions column, this list just indicates those functions the sample is designed to specifically demonstrate.</p>
<p>&nbsp; </p>
<table class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Working Sample </h5></td>
    <td><h5>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h5></td>
    <td><h5>Highlighted Functions </h5></td>
    <td><h5>Highlighted Structures </h5></td>
  </tr>
  <tr>
    <td><p><a href="Samples/AI Objects and Waypoints/AI Objects and Waypoints/AIObjects.cpp"><b>AI Objects and Waypoints</b></a><b><a name="AIObjectsandWaypoints"></a> </b></p></td>
    <td>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. </td>
    <td align="left" valign="top"><p><b><a href="#SimConnect_SetDataOnSimObject">SimConnect_SetDataOnSimObject</a></b></p>
        <p><b><a href="#SimConnect_AICreateSimulatedObject">SimConnect_AICreateSimulatedObject</a></b></p>
      <p><b><a href="#SimConnect_AICreateNonATCAircraft">SimConnect_AICreateNonATCAircraft</a></b></p></td>
    <td><p><b><a href="#SIMCONNECT_DATA_INITPOSITION">SIMCONNECT_DATA_INITPOSITION</a></b></p>
        <p><b><a href="#SIMCONNECT_DATA_WAYPOINT">SIMCONNECT_DATA_WAYPOINT</a></b></p>
      <p><b><a href="#SIMCONNECT_RECV_ASSIGNED_OBJECT_ID">SIMCONNECT_RECV_ASSIGNED_OBJECT_ID</a></b></p></td>
  </tr>
  <tr>
    <td><p><a href="Samples/AI Traffic/AI Traffic/AITraffic.cpp"><b>AI Traffic </b></a><a name="AITraffic"></a></p></td>
    <td><p>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. </p>
        <p>Make sure to move the flight plan included with this sample (IFR Yakima Air Term Mcallister to Spokane Intl.pln ) to the default <i>Flight Simulator X Files</i> directory before running this sample. </p></td>
    <td><p><b><a href="#SimConnect_AISetAircraftFlightPlan">SimConnect_AISetAircraftFlightPlan</a></b></p>
        <p><b><a href="#SimConnect_AICreateEnrouteATCAircraft">SimConnect_AICreateEnrouteATCAircraft</a></b></p>
      <p><b><a href="#SimConnect_AICreateParkedATCAircraft">SimConnect_AICreateParkedATCAircraft</a></b></p>
      <p>&nbsp;</p></td>
    <td><p><b><a href="#SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE">SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE</a></b></p>
        <p><b><a href="#SIMCONNECT_RECV_ASSIGNED_OBJECT_ID">SIMCONNECT_RECV_ASSIGNED_OBJECT_ID</a></b></p>
      <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Client Event/Client Event/ClientEvent.cpp"><b>Client Event </b></a><a name="ClientEvent"></a></p></td>
    <td>Request notifications of a simulation event, the applying of the user aircraft's brakes in this case. </td>
    <td><p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p>
        <p><b><a href="#SimConnect_AddClientEventToNotificationGroup">SimConnect_AddClientEventToNotificationGroup</a></b></p>
      <p><b><a href="#SimConnect_SetNotificationGroupPriority">SimConnect_SetNotificationGroupPriority</a></b></p>
      <p><b><a href="#SimConnect_CallDispatch">SimConnect_CallDispatch</a></b></p>
      <p>&nbsp;</p></td>
    <td><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Cockpit Camera/Cockpit Camera/CockpitCamera.cpp"><b>Cockpit Camera </b></a><a name="CockpitCamera"></a></p></td>
    <td>Banks the user's view camera left and right in response to certain key presses.</td>
    <td><p><b><a href="#SimConnect_CameraSetRelative6DOF">SimConnect_CameraSetRelative6DOF</a></b></p>
        <p><b><a href="#SimConnect_MapInputEventToClientEvent">SimConnect_MapInputEventToClientEvent</a></b></p>
      <p><b><a href="#SimConnect_AddClientEventToNotificationGroup">SimConnect_AddClientEventToNotificationGroup</a></b></p>
      <p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p></td>
    <td><p><b><a href="#SIMCONNECT_EXCEPTION">SIMCONNECT_RECV_EXCEPTION</a></b></p>
        <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td><a href="Samples/Dialog Box Mode/Dialog Box Mode/DialogBoxMode.cpp"><b>DialogBoxMode</b></a><a name="DialogBoxMode"></a></td>
    <td>Sets Dialog mode, displays a message box, then resets Dialog mode. </td>
    <td><p><A HREF="#SimConnect_SetSystemState"><B>SimConnect_SetSystemState</B></A></p>
    <p><b><a href="#SimConnect_RequestSystemState">SimConnect_RequestSystemState</a></b></p></td>
    <td><a style="font-weight: bold;" href="#SIMCONNECT_RECV_SYSTEM_STATE">SIMCONNECT_RECV_SYSTEM_STATE</a></td>
  </tr>
  <tr>
    <td><a href="Samples/Input Event/Input Event/InputEvent.cpp"><b>Input Event </b></a><a name="InputEvent"></a></td>
    <td>Applies the user aircraft brakes by pressing the Ctrl-Shift-U key combination. </td>
    <td><p><b><a href="#SimConnect_MapInputEventToClientEvent">SimConnect_MapInputEventToClientEvent</a></b></p>
        <p><b><a href="#SimConnect_SetInputGroupState">SimConnect_SetInputGroupState</a></b></p></td>
    <td><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Joystick Input/Joystick Input/JoystickInput.cpp"><b>Joystick Input </b></a><a name="JoystickInput"></a></p></td>
    <td>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. </td>
    <td><p><b><a href="#SimConnect_SetInputGroupState">SimConnect_SetInputGroupState</a></b></p>
        <p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p>
      <p><b><a href="#SimConnect_AddClientEventToNotificationGroup">SimConnect_AddClientEventToNotificationGroup</a></b></p>
      <p><b><a href="#SimConnect_MapInputEventToClientEvent">SimConnect_MapInputEventToClientEvent</a></b></p>
      <p>&nbsp;</p></td>
    <td><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Menu items/Menu items/MenuItems.cpp"><b>Menu Items </b></a><a name="MenuItems"></a></p></td>
    <td>Adds and removes a menu item. </td>
    <td><p><b><a href="#SimConnect_MenuAddItem">SimConnect_MenuAddItem</a></b></p>
        <p><b><a href="#SimConnect_MenuDeleteItem">SimConnect_MenuDeleteItem</a></b></p>
      <p><b><a href="#SimConnect_RemoveClientEvent">SimConnect_RemoveClientEvent</a></b></p>
      <p><b><a href="#SimConnect_AddClientEventToNotificationGroup">SimConnect_AddClientEventToNotificationGroup</a></b></p>
      <p>&nbsp;</p></td>
    <td><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Mission Action/Mission Action/MissionAction.cpp"><b>Mission Action </b></a><a name="MissionAction"></a></p></td>
    <td>Interfaces with a mission xml file to provide some additional processing to mission actions, and when missions are completed. </td>
    <td><p><b><a href="#SimConnect_ExecuteMissionAction">SimConnect_ExecuteMissionAction</a></b></p>
        <p><b><a href="#SimConnect_CompleteCustomMissionAction">SimConnect_CompleteCustomMissionAction</a></b></p>
      <p><b><a href="#SimConnect_SubscribeToSystemEvent">SimConnect_SubscribeToSystemEvent</a></b></p>
      <p><b>WaitForSingleObject</b></p></td>
    <td><p><b><a href="#SIMCONNECT_RECV_CUSTOM_ACTION">SIMCONNECT_RECV_CUSTOM_ACTION</a></b></p></td>
  </tr>
  <tr>
    <td><p><a href="Samples/No Callback/No Callback/NoCallback.cpp"><b>No Callback </b></a><a name="NoCallback"></a></p></td>
    <td>Similar to the Client Event sample, but written without a callback function. </td>
    <td><b><a href="#SimConnect_GetNextDispatch">SimConnect_GetNextDispatch</a></b></td>
    <td><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Open and Close/Open and Close/OpenClose.cpp"><b>Open and Close </b></a><a name="OpenandClose"></a></p></td>
    <td>Simply opens and closes a connection with the SimConnect server. </td>
    <td><p><b><a href="#SimConnect_Open">SimConnect_Open</a></b></p>
        <p><b><a href="#SimConnect_Close">SimConnect_Close</a></b></p></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><a href="Samples/Request Data/Request Data/RequestData.cpp"><b>Request Data </b></a><a name="RequestData"></a></td>
    <td>Requests a small selection of data on the user's aircraft, including latitude, longitude and altitude. </td>
    <td><p><b><a href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a></b></p>
        <p><b><a href="#SimConnect_RequestDataOnSimObjectType"></a></b></p></td>
    <td><p><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></p>
        <p><b><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA">SIMCONNECT_RECV_SIMOBJECT_DATA</a></b></p></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Reserved Key/Reserved Key/ReservedKey.cpp"><b>Reserved Key </b></a><a name="ReservedKey"></a></p></td>
    <td>Requests that one of the three keys specified be reserved for this client. </td>
    <td><p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p>
        <p><b><a href="#SimConnect_RequestReservedKey">SimConnect_RequestReservedKey</a></b></p></td>
    <td><b><a href="#SIMCONNECT_RECV_RESERVED_KEY">SIMCONNECT_RECV_RESERVED_KEY</a></b></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Send Event A/Send Event A/SendEventA.cpp"><b>Send Event A </b></a><a name="SendEventA"></a></p></td>
    <td>To be used in combination with Send Event B and Send Event C. Transmits custom events to the two other clients. </td>
    <td><p><b><a href="#SimConnect_TransmitClientEvent">SimConnect_TransmitClientEvent</a></b></p>
        <p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p>
      <p><b><a href="#SimConnect_AddClientEventToNotificationGroup">SimConnect_AddClientEventToNotificationGroup</a></b></p>
      <p><b><a href="#SimConnect_SetNotificationGroupPriority">SimConnect_SetNotificationGroupPriority</a></b></p></td>
    <td><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Send Event B/Send Event B/SendEventB.cpp"><b>Send Event B </b></a><a name="SendEventB"></a></p></td>
    <td>Receives custom events from Send Event A, at a higher priority than Send Event C. </td>
    <td><p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p>
        <p><b><a href="#SimConnect_AddClientEventToNotificationGroup">SimConnect_AddClientEventToNotificationGroup</a></b></p>
      <p><b><a href="#SimConnect_SetNotificationGroupPriority">SimConnect_SetNotificationGroupPriority</a></b></p></td>
    <td><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Send Event C/Send Event C/SendEventC.cpp"><b>Send Event C </b></a><a name="SendEventC"></a></p></td>
    <td>Receives custom events from Send Event A, at a lower priority than Send Event B. </td>
    <td><p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p>
        <p><b><a href="#SimConnect_AddClientEventToNotificationGroup">SimConnect_AddClientEventToNotificationGroup</a></b></p>
      <p><b><a href="#SimConnect_SetNotificationGroupPriority">SimConnect_SetNotificationGroupPriority</a></b></p></td>
    <td><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Set Data/Set Data/SetData.cpp"><b>Set Data </b></a><a name="SetData"></a></p></td>
    <td>When a certain key is pressed, the position of the user aircraft is changed. </td>
    <td><p><b><a href="#SimConnect_SetDataOnSimObject">SimConnect_SetDataOnSimObject</a></b></p>
        <p><b><a href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a></b></p>
      <p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p>
      <p><b><a href="#SimConnect_MapInputEventToClientEvent">SimConnect_MapInputEventToClientEvent</a></b></p>
      <p><b><a href="#SimConnect_SetInputGroupState">SimConnect_SetInputGroupState</a></b></p></td>
    <td><p><b><a href="#SIMCONNECT_DATA_INITPOSITION">SIMCONNECT_DATA_INITPOSITION</a></b></p>    </td>
  </tr>
  <tr>
    <td><p><a href="Samples/System Event/System Event/SystemEvent.cpp"><b>System Event </b></a><a name="SystemEvent"></a></p></td>
    <td>Notifies the client when a FlightLoaded event has occured. </td>
    <td><b><a href="#SimConnect_SubscribeToSystemEvent">SimConnect_SubscribeToSystemEvent</a></b></td>
    <td><p><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></p>
        <p><b><a href="#SIMCONNECT_RECV_EVENT_FILENAME">SIMCONNECT_RECV_EVENT_FILENAME</a></b></p></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Tagged Data/Tagged Data/TaggedData.cpp"><b>Tagged Data </b></a><a name="TaggedData"></a></p></td>
    <td>Requests the vertical speed and pitot heat switch settings on the user aircraft, but only when this data changes. </td>
    <td><p><b><a href="#SimConnect_RequestDataOnSimObject">SimConnect_RequestDataOnSimObject</a></b></p>
        <p><b><a href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a></b></p></td>
    <td><p><b><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA">SIMCONNECT_RECV_SIMOBJECT_DATA</a></b></p>    </td>
  </tr>
  <tr>
    <td><p><a href="Samples/Throttle Control/Throttle Control/ThrottleControl.cpp"><b>Throttle Control </b></a><a name="ThrottleControl"></a></p></td>
    <td>Controls the user aircraft throttle using two specified keys. </td>
    <td><p><b><a href="#SimConnect_SetDataOnSimObject">SimConnect_SetDataOnSimObject</a></b></p>
        <p><b><a href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a></b></p>
      <p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p>
      <p><b><a href="#SimConnect_MapInputEventToClientEvent">SimConnect_MapInputEventToClientEvent</a></b></p>
      <p><b><a href="#SimConnect_SetInputGroupState">SimConnect_SetInputGroupState</a></b></p></td>
    <td><p><b><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE"></a></b></p>
        <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Tracking Errors/Tracking Errors/TrackingErrors.cpp"><b>Tracking Errors </b></a><a name="TrackingErrors"></a></p></td>
    <td>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.</td>
    <td><p><b><a href="#SimConnect_GetLastSentPacketID">SimConnect_GetLastSentPacketID</a></b></p>
        <p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p>
      <p><b><a href="#SimConnect_AddClientEventToNotificationGroup">SimConnect_AddClientEventToNotificationGroup</a></b></p>
      <p><b><a href="#SimConnect_SetNotificationGroupPriority">SimConnect_SetNotificationGroupPriority</a></b></p>
      <p><b><a href="#SimConnect_CallDispatch">SimConnect_CallDispatch</a></b></p></td>
    <td><p><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></p>
        <p><b><a href="#SIMCONNECT_EXCEPTION">SIMCONNECT_RECV_EXCEPTION</a></b></p></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Variable Strings/Variable Strings/VariableStrings.cpp"><b>Variable Strings </b></a><a name="VariableStrings"></a></p></td>
    <td>Extracts three variable length strings from a structure. </td>
    <td><p><b><a href="#SimConnect_RetrieveString">SimConnect_RetrieveString</a></b></p>
        <p><b><a href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a></b></p>
      <p><b><a href="#SimConnect_RequestDataOnSimObjectType">SimConnect_RequestDataOnSimObjectType</a></b></p></td>
    <td><p><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></p>
        <p><b><a href="#SIMCONNECT_EXCEPTION">SIMCONNECT_RECV_EXCEPTION</a></b></p>
      <p><b><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE">SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE</a></b></p></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Weather Station/Weather Station/WeatherStation.cpp"><b>Weather Station </b></a><a name="WeatherStation"></a></p></td>
    <td>Requests weather data from the nearest weather station to the user aircraft, every 10 seconds. </td>
    <td><p><b><a href="#SimConnect_WeatherGetObservationAtNearestStation">SimConnect_WeatherRequestObservationAtNearestStation</a></b></p>
        <p><b><a href="#SimConnect_RequestDataOnSimObject">SimConnect_RequestDataOnSimObject</a></b></p>
      <p>&nbsp;</p></td>
    <td><p><b><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA">SIMCONNECT_RECV_SIMOBJECT_DATA</a></b></p>
        <p><b><a href="#SIMCONNECT_RECV_WEATHER_OBSERVATION">SIMCONNECT_RECV_WEATHER_OBSERVATION</a></b></p></td>
  </tr>
  <tr>
    <td><p><a href="Samples/Windows Event/Windows Event/WindowsEvent.cpp"><b>Windows Event </b></a><a name="WindowsEvent"></a></p></td>
    <td>Uses a Windows Event to improve the waiting time performance of a client. </td>
    <td><p><b>CreateEvent</b></p>
        <p><b><a href="#SimConnect_Open">SimConnect_Open</a></b></p>
      <p><b>WaitForSingleObject</b></p></td>
    <td><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><h6><a name="Managedcodesamples">Managed Code Samples</a></h6></td>
    <td>&nbsp;</td>
    <td><p>&nbsp;</p></td>
    <td><p>&nbsp;</p>    </td>
  </tr>
  <tr>
    <td><a href="Samples/Managed Client Event/Managed Client Event/Client Event.cs"><b>Managed Client Event</b></a><a name="ManagedClientEvent"></a></td>
    <td>Requests Pitot heat switch and Flaps events. </td>
    <td><p><b><a href="#SimConnect_MapClientEventToSimEvent">SimConnect_MapClientEventToSimEvent</a></b></p>
        <p><b><a href="#SimConnect_AddClientEventToNotificationGroup">SimConnect_AddClientEventToNotificationGroup</a></b></p>
        <p><b><a href="#SimConnect_SetNotificationGroupPriority">SimConnect_SetNotificationGroupPriority</a></b></p>
      <p><b>OnRecvEvent</b></p></td>
    <td><p><b><a href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a></b></p>
      <p><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></p>
    <p><b><a href="#SIMCONNECT_EXCEPTION">SIMCONNECT_RECV_EXCEPTION</a></b></p></td>
  </tr>
  <tr>
    <td><a href="Samples/Managed System Event/Managed System Event/System Event.cs"><b>Managed System Event</b></a><a name="ManagedSystemEvent"></a></td>
    <td>Requests 4 second and simulation state system notifications.</td>
    <td><p><b><a href="#SimConnect_SubscribeToSystemEvent">SimConnect_SubscribeToSystemEvent</a></b></p>
    <p><b><a href="#SimConnect_UnsubscribeFromSystemEvent">SimConnect_UnsubscribeFromSystemEvent</a></b></p></td>
    <td><p><b><a href="#SIMCONNECT_RECV">SIMCONNECT_RECV</a></b></p>
      <p><b><a href="#SIMCONNECT_RECV_EVENT">SIMCONNECT_RECV_EVENT</a></b></p>
    <p><b><a href="#SIMCONNECT_EXCEPTION">SIMCONNECT_RECV_EXCEPTION</a></b></p></td>
  </tr>
  <tr>
    <td><a href="Samples/Managed Data Request/Managed Data Request/Data Request.cs"><b>Managed Data Request</b></a><a name="ManagedDataRequest"></a></td>
    <td>Click a button to request the title, latitude, longitude and altitude of the user aircraft. </td>
    <td><p><b><a href="#SimConnect_AddToDataDefinition">SimConnect_AddToDataDefinition</a></b></p>
    <p><b>RegisterDataDefineStruct</b></p>
    <p><b>OnRecvSimobjectDataBytype</b></p>
    <p><b><a href="#SimConnect_RequestDataOnSimObjectType"></a></b></p></td>
    <td><b><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA">SIMCONNECT_RECV_SIMOBJECT_DATA</a><a href="#SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE"></a></b></td>
  </tr>
</table>
<BR>
<HR>
<div align="center">
  <p>&nbsp;</p>
  <p>&copy; 2006 Microsoft Corporation. All rights reserved. </p>
  <p align="center">~~@~~ </p>
</div>
</body>
</html>
