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.

fs9gps in C/C++ gauges

Featured Replies

I have searched for a while and found several code piecesFor example PCSTRINGZ str;execute_calculator_code("(C:fs9gps:FlightPlanTitle,string)",NULL,NULL,&str);But it always return "0." string in both FS9 and FSX, also tryed several other variabled and got zeroes all the times. FLight plan was loaded of course.What I need is a reliable way to extract flight plan from GPS. In FS9 I use pGaugeCallback with GPS variables IDs in gpsprop.h file that was posted here long ago. Works well in FS9 but doesn't work in FSX, pGaugeCallback->GetPropertyValue(FS9GPS_FlightPlanWaypointsNumber, &wptCount) always returns zero.There is also the old way: GPS_INFO* gpsinfo = NULL; MODULE_VAR var; initialize_var_by_name (&var, GPS_INFO_PANEL_VARIABLE_NAME); gpsinfo = (GPS_INFO*)var.var_ptr;But it also gives NULL pointer sometimes.Can anyone help to deal with it?

I have exactly the same trouble as in this topic http://forums.avsim.net/dcboard.php?az=sho...36864&mode=fullI tryed to make some simple XML gauge that should copy some values from C:fs9gps to L: variables, which I can read in C code.And I've got into trouble with strings copyingI can display a string by code%((@c:FlightPlanDepartureAirportIdent,string))%!s!But when I try to copy this value (@c:FlightPlanDepartureAirportIdent,string) (> L:FlightPlanDepartureAirportIdent,string)L:FlightPlanDepartureAirportIdent only get "0." value!Something simpler like 'test' (> L:TestVar,string) doesn't work either

LVars don't support string assignments ie if you something like this:'test' (>L:MyVar,string) the content of L:MyVar will be 0.Only CustomVars (C: type) support strings, providing you enable string properties on your custom C++ DLL.Tom

thank you for the answerIt seems chr and ord symbol by symbol is the only way :(

  • Moderator

FS9 had gps_export.dll in the Modules folder. FSX has no Modules folder, having moved all .dll files to the root FSX folder.Either copy/paste a copy of gps_export.dll to your root FSX folder, or create a Modules folder, place a copy of gps_export.dll there, then edit your dll.xml file to define and load it.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

It has nothing to do with gps_export.dllActually the old way works fine when you load a saved flight but doesn't when you create a new one.Managed to complete my job with callback interfaces in C++, had completely forgotten about ConvertStringToProperty call. FS9 and FSX have different IDs for variables and that's why it refused to work with FS9 hardcoded values in gpsprop.hStill have some issues, but minimal required functionality works well ;)

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.