• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Using execute_calculator_code() to transfer L vars between C and XML

Messages
516
I've written a bunch of gauges in C and am using XML gauges to display the results, exports values from the C using execute_calculator_code().

Everything works fine on my PC, but it doesn't work on someone elses. The displayed values just stick at zero and never change.

I know I'm doing it properly because it works on my PC without a problem, so my guess is it has to be somethign specific to either my PC or my FS installation. (We're both using Acceleration.)

the only thing I can think of is that there's maybe some runtime library dependency issue. I'm statically linking msvcr90.dll to my .gau file but that's not solved it. The only other dependency is kernel32.dll, but I shouldn't ever need to link that too, should I as it's a part of Windows?

Has anyone ever encountered this problem?

Thanks,

Si
 
Hi,

If current situation is this:

-You have a C gauge that performs execute_calculator ok but the SAME gauge doesn't work for other people.
-You and other people have the same FS version and installation.

Then the problem is a lack of libraries for the other people, definitely. For example, specific runtime libraries must be installed for users of gauges/dlls made with VC++ 200x (ie vcredist_x86.exe). You should try to figure out which redistributable might be needed in your case.

Tom
 
According to depends.exe, the only dll dependency I have is simconnect.dll since I static linked msvcr90.dll, but I got to try my gauges on three more different PCs today and it worked on two but not the third. Perhaps tellingly the one it didn't work on is a clean WinXP SP2 with FSX SP2 installed.

However, I've since discovered that it's not the execute_calculator_code() that's not working, but my code that writes sets the variable that the gauge displays. But I cannot find anything wrong with it and it works fine on my PC. It does however depend on values it gets from the sim using aircraft_varget(), so perhaps there's a problem there with a dependency elsewhere.

Anyone know whether C gauges have any other dll or Windows system dependencies other than the visual studio runtime, like a specific .net framework or anything?

Si

Edit: It may be worth mentioning that I am using Visual C++ Express 2008, rather than 2005. I have used 2005 in the past so the runtimes may still be on my PC. So even if I am linking in msvcr90.dll, perhaps it is looking for msvcr80.dll at runtime.
 
Last edited:
I've never had much success with varget, but that may just be me... ;)

It would actually help more to see an example of the actual code, (both C and XML) that you're having problems with.
 
I had serveral complaints from people who tested my gauges that they didn't work. Installing Visual Studio 2008 Redistributable Package on their computers solved the problems, just as taguilo suggested earlier.

I also use C code that sets XML variables that control animations. And I also compiled my gauges with vs2008.
 
We got it working. I just needed to add all the library dependencies that VS2008 adds to Win32 projects by default, but aren't included in the SimConnect SDK example project settings, then link them all statically (so no need for redistributable runtime.)

Si
 
Back
Top