August 15, 200817 yr 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?
August 22, 200817 yr 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
August 22, 200817 yr 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
August 22, 200817 yr thank you for the answerIt seems chr and ord symbol by symbol is the only way :(
August 26, 200817 yr 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
August 31, 200817 yr 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