July 23, 200322 yr Hey poeple.What I need is to get the VOR ID as a string, preferably WCHAR. If anyone can help, thanks a lot. :)Etienne
July 23, 200322 yr I'm not 100% sure, but wasn't it:MODULE_VAR vor_id={VOR1_IDENTITY};...lookup_var(&vor_id); and treat vor_id.var_value.d as *char?e.g.sprintf(pelement->string,"%s",vor_id.var_value.d);Arne Bartels
July 23, 200322 yr Actually, this is (altough being an union, better for the compiler):vor_id.var_value.p (dot p like "pointer")it is a PCHAR.Hope this helps!
July 24, 200322 yr Thx. But now I only get displayed crap; how do I get the PCHAR converted to a WCHAR?
July 25, 200322 yr WCHAR foo[whateversize];swprintf(foo, "%S", x.var_value.p);It has to be a capital "%S" to convert the PCHAR to a WCHAR. If you use "%s", swprintf() would expect a WCHAR parameter.
July 25, 200322 yr >Thanks, Hans. The S did the actual trick. :-)FLOAT64 FSAPI callback17( PELEMENT_STRING pelement){PVOID rwert=pelement->source_var[0].var_value.p;;if ( panellights == 1 ) { LIGHT_IMAGE(pelement) ; } else { DARKEN_IMAGE(pelement) ; } if ( AVIONICS_CIRCUIT_ONvar.var_value.n == 1 && nav_gps == 0 ) { SHOW_IMAGE(pelement) ; } else { HIDE_IMAGE(pelement) ; } sprintf(pelement->string,"%s",rwert);return 0;}Notice that I didn't need the "capital S" in the sprintf statement... :)BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg
July 25, 200322 yr Bill,you're right. But since Etienne wanted a WCHAR, swprintf is a better solution. I think, it's because he uses the GDI+ DrawString() function that only accepts a WCHAR parameter.
Create an account or sign in to comment