Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FlightLoaded never happens?

Featured Replies

  • Commercial Member

Hi,I've been messing around with SimConnect (from within a gauge) for a few weeks now and was able to do everything I planned to do so far except for retrieving the name of the currently loaded flight.

static enum EVENT{   EVENT_FLIGHT_LOADED,   EVENT_FLIGHT_SAVED,};void OpenSimConnect(){	HRESULT hr;	if (SUCCEEDED(SimConnect_Open(&hSimConnect, "SimCheck SimConnect", NULL, 0, 0, 0)))	{	   hr = SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_FLIGHT_LOADED, "FlightLoaded");	   hr = SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_FLIGHT_SAVED, "FlightSaved");	   SimConnect_CallDispatch(hSimConnect, SCDispatchProc, NULL);	}}void CALLBACK SCDispatchProc(SIMCONNECT_RECV* pData, DWORD cbData, void *pContext){   switch(pData->dwID)   {	   //FLIGHT SAVE	   case SIMCONNECT_RECV_ID_EVENT_FILENAME:		{			SIMCONNECT_RECV_EVENT_FILENAME *evt = (SIMCONNECT_RECV_EVENT_FILENAME*)pData;			switch(evt->uEventID)			{				case EVENT_FLIGHT_LOADED:					sprintf(loadname, "%s", evt->szFileName); 					LoadAircraftData();				break;				case EVENT_FLIGHT_SAVED:					 sprintf(savename, "%s", evt->szFileName); 					 SaveAircraftData();				break;				default:				break;			}			break;		}		default:		break;	}}

Unfortunately the EVENT_FLIGHT_LOADED event NEVER occurs ! EVENT_FLIGHT_SAVED works fine!Has anyone been able to get this to work ?Thx,Bj

simcheck_sig_banner_devteam.jpg

 

Bj

  • Author
  • Commercial Member

Found it and fixed it...Bj

simcheck_sig_banner_devteam.jpg

 

Bj

  • Commercial Member
LOL... not even going to say what the problem was, how it was fixed??
I'll answer for Bj

Win10: 22H2 19045.2728
CPU: 9900KS at 5.5GHz
Memory: 32Gb at 3800 MHz.
GPU:  RTX 24Gb Titan
2 x 2160p projectors at 25Hz onto 200 FOV curved screen

  • Author
  • Commercial Member
He is using SimConnect in a Gauge. Gauges are loaded when the flight is loaded, but of course are not yet connected when the "FlightLoaded" event occurs. He just needed instead to get the FlightLoaded system state upon initialisation.
Sorry guys, and thx Pete. Yes the FlightLoaded event doesn't occur because the gauge is reloaded completely when a new flight is loaded !I now retrieve the current flightname during the SimConnect initialization.Bj

simcheck_sig_banner_devteam.jpg

 

Bj

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.