Jump to content
The simFlight Network Forums

Breaking Changes for MSFSVariableServices in Version 3.2.19


Recommended Posts

Version 3.2.19

Unfortunately, I've had to introduces some breaking changes to MSFSVariableServices.

This had to be done as the old way was wrong and was (understandably) causing confusion for users working with this class for the first time.

The breaking changes are:

1. The MSFSVariableServices is now a static class. 

Until now, you needed to make an instance of the class: e.g.

MSFSVariableServices vs = new MSFSVariableServices();

This implies that more than one can be created and that you can dispose of this class. This is not the case because of how the FSUIPC_WAPID.DLL works. 

Now you directly access the class using it's name. e.g. 

MSFSVariableServices.Start();

You can no longer create instances.

If you don't like using the full name you can create an alias at the top of your code file:

C#

using VS = FSUIPC.MSFSVariableServices;

VB.NET

Imports VS = FSUIPC.MSFSVariableServices

This will let you just use 'VS':

VS.Open();


2. You can no longer access an LVar or HVar based on it's ID. 

You can only use the variable name now. The ID was arbitrary and had nothing to do with MSFS. I can't imagine the ID was useful at all so it's been removed to simplify things.


Bug fix:

MSFSVariableServices.CreateLVar() now accepts a double instead of an integer.


Improvement:

Any FsLVar/FSHVar objects you keep a reference to will persist between Reload() and Stop()/Start()  calls. This means any ValueChanged events you have registered will still be valid. In the previous version, new FsLVar/FsHVar objects were created by the DLL meaning your exiting references and events stopped working.


The example code applications in C# and VB.NET have been updated (V1.2) to use the new version of the DLL: 

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

Paul

Link to comment
Share on other sites

  • Paul Henty changed the title to Breaking Changes for MSFSVariableServices in Version 3.2.19

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

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