about API simconnect.RequestFacilitiesList

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

about API simconnect.RequestFacilitiesList

Post by ppp333ddd_ »

Hi,

I am trying to read the name of the airport using C# WPF. There is an example project called Managed Facility Request written by C# Winform is SDK.

I know the SIMCONNECT_RECV_AIRPORT_LIST structure is used to return a list of SIMCONNECT_DATA_FACILITY_AIRPORT structures. But when I set the breakpoint in function buttonRequestAirports_Click, it just jumps to function DefWndProc. After some loops, it comes to the end and display the Icao, Latitude,etc. I did not find where the program writes the returned values to the richbox, i.e. Icao, Latitude,etc.

private void buttonRequestAirports_Click(object sender, EventArgs e)
{
simconnect.RequestFacilitiesList(SIMCONNECT_FACILITY_LIST_TYPE.AIRPORT, DATA_REQUESTS.NONSUBSCRIBE_REQ);
displayText("Airports request sent...");
}

protected override void DefWndProc(ref Message m)
{
if (m.Msg == WM_USER_SIMCONNECT)
{
if (simconnect != null)
{
simconnect.ReceiveMessage();
}
}
else
{
base.DefWndProc(ref m);
}
}

Can anyone explain how does the function buttonRequestAirports_Click display Icao, Latitude,etc. onto the richbox so that I can imitate it and display these values on WPF? Thanks!

Kind regards,

Jeff
Locked