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.

Set/Get XML variables in C#

Featured Replies

I am confused. I don't know about panel and gauge design and also C++. 

I looked up almost every thing about change some special designed panel switch  and get developer designed gauge values via C#. 

ddawson (thanks a lot) made some .dll for get and set some (L:vars) I try to use them in my C# app but I could't import them into the my C# project.

My stuation :

1. I am using prof licensed P3D v4.

2. I am using C# application(VS2019) to get and set some variable from aircraft via simconnect that everything is ok.

3. I have a helicopter add-on that was created "Cera Sim" and some special panels and switches and gauges. (example:   (L:Swbatt, bool) ,  (L:Swfpapu, enum) ,  (L:Start_Eng2, bool), (>K:PROP_PITCH2_LO), etc.).

The question that:

1.How can I change the position of the switches via my C# app?

2. How can I get the special gauge values to my app?

3. Are the anyone to have any C# project to make which I want. 

4. Is there any way the control them with joystick buttons or keyboard?

Thank you

Edited by tilkisinan

  • Commercial Member
2 hours ago, tilkisinan said:

3. Are the anyone to have any C# project to make which I want. 

Yes. But C# managed code alone won't do. An external app cannot access LVars. You need a second module, a C++ DLL, that is loaded in the simulator. An internal DLL can read and write LVars, so all you have to do is to make one, and then make your C# app communicate with it (for example using a shared data area in SimConnect).

Or you use FSUIPC (which is exactly that DLL inside the sim) and find a way to communicate with it from a C# app.

Best regards

LORBY-SI

  • Author

Thank you for your reply. Lorby_SI do you have a .dll that made from C++ for use C#? 

vv1918 I have already asked there. Thankyou.

Edited by tilkisinan

  • Commercial Member
3 minutes ago, tilkisinan said:

 Lorby_SI do you have a .dll that made from C++ for use C#? 

I do - but are you willing to pay for that? These modules are not generic, I make custom ones for every app where I need that functionality. Is it for a freeware or payware project?

You should be able to make your own. The "Mixed Mode Sample" from the panels SDK shows you how to access LVars using C++. You just have to customize it and add the SimConnect shared data area on both ends (in the DLL and in your C# code). I remember an example for SimConnect integration into the DLL from the FSX SDK, I think that it was the GDI+ example gauge. Not sure if there is sample code in the current P3D SDK.

But - I also thought that the "classic" solution is by implementing some sort of FSUIPC wrapper. Or use LUA scripts? Or both? But I know nothing whatsoever about either of those.

Best regards

LORBY-SI

Archived

This topic is now archived and is closed to further replies.

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.