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.

VOR1_IDENTITY - How to use?

Featured Replies

Hey poeple.What I need is to get the VOR ID as a string, preferably WCHAR. If anyone can help, thanks a lot. :)Etienne

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

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!

swprintf instead of sprintf?Arne Bartels

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.

Or bstr_t class can be used for conversion

>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

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

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.