Jump to content
Sign in to follow this  
dragonflightdesign

Getting the FLT file being loaded

Recommended Posts

Is it possible? The obvious answer is to check the 'Last_Accessed' attribute on the flt file but as the operating system can defer stamping that information to the file for up to an hour, it's not really a lot of use. Finding which flt file has just been saved is relatively easy as the 'Last_Modified' attribute is stamped within two seconds. As the flt file is really just an ini file, I'd like to use it to store additional panel information associated with that flight.

Share this post


Link to post
Share on other sites

The SimcConnect API

HRESULT SimConnect_RequestSystemState

(

HANDLE  hSimConnect,

SIMCONNECT_DATA_REQUEST_ID  RequestID,

const char*  szState

);

 

where the null-terminated string szState identifies the system function:
 

AircraftLoaded Requests the full path name of the last loaded aircraft flight dynamics file. These files have a .AIR extension.

 
DialogMode Requests whether the simulation is in Dialog mode or not. See SimConnect_SetSystemState for a description of Dialog mode.

 
FlightLoaded Requests the full path name of the last loaded flight. Flight files have the extension .FLT.

 
FlightPlan Requests the full path name of the active flight plan. An empty string will be returned if there is no active flight plan.

Sim 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.

Share this post


Link to post
Share on other sites

Thanks guys. I'm pleased to see that it can be done 'natively' because I'm desparately trying to avoid the use of any third-party addon for this project. We'll see if I succeed... :smile:

Share this post


Link to post
Share on other sites

Just a word of caution... Prepar3D v2.5 has panel state saving built in... might want to look into that before someone shoves your project into that and things get crossed. :)


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...