November 19, 200520 yr Moderator I have been trying without success to read the XML token A:atc id, string and display it in a C gauge... Here is what I've tried so far. All I get for my trouble is an "N" showing up...: WCHAR n_number[15] = L"N200SR";//----------------------case PANEL_SERVICE_PRE_UPDATE:execute_calculator_code("(A:atc id, string)",&n_number,NULL,NULL);break;//----------------------FLOAT64 FSAPI atc_cb( PELEMENT_STRING pelement){swprintf(pelement->string, L"%s", n_number);return 0;}MAKE_STRING(String_atc,NULL,NULL,IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY | BIT7,0,8,5,98,27,1000000,MODULE_VAR_NONE,MODULE_VAR_NONE,MODULE_VAR_NONE,RGB(85,79,79),RGB(0,0,0),RGB(0,0,0),GAUGE_FONT_DEFAULT,GAUGE_WEIGHT_DEFAULT,GAUGE_CHARSET,0,0,NULL,atc_cb)PELEMENT_HEADER ElementList2[] = {&String_atc.header,NULL}; Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
November 19, 200520 yr Bill,This seems to work:PCSTRINGZ n_number;execute_calculator_code("(A:atc id, string)",NULL,NULL,&n_number);sprintf(pelement->string,"ATC %s", n_number );The execute_calculator_code function is pretty adament about having the string variable in the form of PCSTRINGZ. Fortunately, the sprintf function is OK with that.Doug
November 19, 200520 yr Author Moderator THANK YOU! :)It works a treat!Now I finally understand how this works:BOOL (FSAPI *execute_calculator_code) (PCSTRINGZ code, FLOAT64* fvalue, SINT32* ivalue, PCSTRINGZ* svalue); Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
April 9, 20206 yr hİ n4gix I am using simconnect in C#. I get or set almost all standart KeyEvents and Simulation variables. But the aircraft contains some variables that special developer panels. (L:Master_AC, bool), (L:ignition, bool) , (L:Swapu, bool) etc. I want to change their values in C#. As much as I understand I should use C++ language and execute_calculator_code to change their values. The problem that I don'y know C++ or XML. Please help me to solve this problem.
April 13, 20206 yr Commercial Member Since LVARS are only accessable via either execute_calculator_code (C code only) or in an XML gauge... I don't see how you're going to solve it. There is no C# support for LVARS. Ed Wilson Mindstar AviationMy Playland - I69
Create an account or sign in to comment