Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello,

very short question, is it possible to create a LVar using C# ?
I think to remember i saw this anywhere, but could not remember...

Thanks
Matthias

Posted
45 minutes ago, mroschk said:

very short question, is it possible to create a LVar using C# ?

If you're using FSUIPC7 (MSFS) and the new MSFSVariableServices class then yes, you can: 

MSFSVariableServices.CreateLVar("L:NewLVar", 0); // (Name, Initial Value)

If you're using FSUIPC6 (i.e. the legacy FSUIPCConnection.ReadLVar() method) it's possible (FSUIPC6 supports creates) but I haven't included it in the DLL. Let me know and I can a add it.

For FSUIPC5 and earlier versions it's not possible to create LVars.

Paul 

Posted

Hello,

i am using MSFS, but i did not know about MSFSVariableServices .
Can you pls give me a little tip how to use it in a C# project ?
Or is it in the FSUIPC description ? ( i am not home right now )

Matthias

Posted

There's an example project that explains how to use it. It also explains where to get a required file called FSUIPC_WAPID.dll that you need, and how to include it in your project.

http://fsuipc.paulhenty.com/#downloads

The example project is a few years old now. If it includes a FSUIPC_WAPID.dll file it could be too old to work so you should get the latest. On the MSFS side you need to install the WASM module which is installed by the FSUIPC installer. So make sure you're also up-to-date with the latest FSUIPC7.

MSFSVariableServices is a completely separate system from the normal connection used for offsets.

It's the preferred way to work with LVars (and HVars) in MSFS as it's hundreds of times faster than FSUIPCConnection.ReadLVar(). 

Paul

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.