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

FSX:SE C++ gauge: Visual studio runtime files not found (and some poetry)

Vitus

Resource contributor
Messages
1,480
Country
newzealand
Good day friends,

So there I was, working away on my sound engine, innocently unaware of the pitfalls of Microsoft SDKs and the big wake of misery caused by inconsiderate and complicated compatibility matters. Now I joined the aforementioned tide of misery and broken dreams - those dreams of quick solutions and never-ending self-praise of the god-like manifestations of un-crashable and sorrow-free programming code.

But enough of the poetry, let's get to business :rotfl:

I am trying to implement a new sound engine into my DLL file and chose Microsoft's XAudio2 for it. If you're not aware of it, XAudio2 is the successor of directSound, which is obsolete for a number of years now. Just like everything else that was formerly packed into the directX redistributable kits, XAudio2 is now a fixed component of the Windows SDK and all necessary system-dlls come pre-installed on any modern Windows platform. However there's a little problem: Since Windows 8, XAudio2 is in version 2.8, which is unavailable to Windows 7 operating systems. So in order to be backwards-compatible I still had to use the dreadful directX SDK, which allowed me to utilize xaudio2, version 2.7. That's all good, with the help of Doug Dawson (thank you so much again!) I got it to compile using the proper library files, hence linking to the correct DLL file.

Next step is to try this wondrous piece of software on my target Windows 7 machine - aaaaaaand: no joy, the DLL won't be loaded by the sim. Doug recommended to check the compiler to make sure that it's set to "Release", which I did check and double check, no luck. So the next logical step was to run the file through "Dependency Walker" and here's the result:
hHYJJc2.png


Easy-peasy, looks as if the VSC++runtime files are missing right? Wrong. I actually uninstalled ALL VS runtime files and installed the latest version again:
kZJbsGz.png


The system files for xAudio2 should be in the 2005 redistributable pack and as you can see, that one is installed.

Soooooooo..... any ideas why this DLL can't access those runtime DLLs?

Thanks for your attention!
 
Good old Microsoft... ran into a similar problem when building a TriStar years ago. The solution was to copy the MSVxxx.DLL file into the same folder as the gauge. No idea why it couldn't find it on the system... then many Windows updates later it started working as it should have done originally.
 
You aren't having a missing library problem. Note that the first dll listed under Simconnect just happens to be the "missing" dll and is indicated as present. The "missing" part is just a quirk of Dependency Walker and can be ignored.

Is your dll a gauge in the panel cfg or a module in the dll.xml?
 
Have you tried compiling with the code generation option /MT, rather than /MD ?
 
Thank you all for trying to help me out!
The DLL is a gauge for my Lockheed Vega, registered in the panel.cfg and at the current state it won't get loaded by FSX/SE on my Win7 machine. However, it works fine on my Win10 development computer.

It's already compiled as "Release" with /MT.

I haven't tried copying the missing files directly into the panel folder, but I am honestly not a fan of that solution...

I didn't change anything to the project settings, other than adding the includes for the 2010 directX SDK.
 
Maybe your problem is not with xAudio at all. What version of SimConnect are you compiling against, and is it properly installed on the test machine?
 
The simConnect.h I include in my project says it's version 10.0.61259.0. The target machine is using version 10.0.62615.0 provided by the steam installation.
But I didn't change anything around simConnect since the implementation of xAudio and directX....
 
You will need to install 10.0.61259 on the Win7 machine. The installer file does ship with SE, but it is not installed by default.
 
I'm not sure the right Simconnect is missing. Otherwise SimConnect would show as missing in Dependency Walker. Although it is a good check to make so do so anyway.

One other thing to check: Right click on dll and go to properties. Check if there is an Unblock button/check mark. Sometimes Windows can do funny stuff and block a dll.
 
I concur with JB3DG. I did't change anything to the simConnect implementation in my dll and it was always working fine. Would be odd if all of a sudden the part that I didn't touch starts to act up?
JB3DG, I'm not entirely sure what you're referring to. This is the properties of the dll:

vyTMxSC.jpg
 
Checked the windows event viewer right after an attempt to load? Tried attaching the VS debugger before selecting the aircraft?
 
I can't find any issues in the Event Viewer - no warnings or errors. And no, I can't attach the VS debugger on the Win7 machine, because I don't have the SDK or VS installed on that machine. But I am fairly certain that the DLL doesn't even load properly - the first thing that happens when the DLL loads is that it writes it's version number into a LVar. This number however stays 0, indicating that no part of the code is actually executed.
 
Maybe check to make sure you don't have old versions of the gauge hidden away somewhere on the Win7 machine?
 
Checked. There's only the current version of my dll on the target system. I install the dll to the panel folder of the aircraft.
 
@Vitus

If the 2 machines are connected on a local network you can copy the remote debugger tools for your VS version over to the other machine, and then run the msvsmon.exe (part of the remote debugger tools). You can then attach across the network.
 
Back
Top