Sign in to follow this  
n4gix

ATC ID in C...

Recommended Posts

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};

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

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

Share this post


Link to post
Share on other sites

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);

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