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

P3D v4 Gauge loading in P3d v4

Messages
32
Country
belgium
I have gauges that I recompiled into 64 bit, but have been unable to load them using the dll.xml file. I am aware of the 2 different files, and I added my entry to the C:\Users\[user]\AppData\Roaming\Lockheed Martin\Prepar3D v4\dll.xml file. But nothing will load.

So I went to the SDK and compiled the Cabin Comfort sample. Added it to the dll.xml file as instructed:

<Launch.Addon>
<Name>Cabin_Comfort</Name>
<Disabled>False</Disabled>
<ManualLoad>False</ManualLoad>
<Path>gauges\Cabin_Comfort.dll</Path>
<DllStartName>module_init</DllStartName>
<DllStopName>module_deinit</DllStopName>
</Launch.Addon>

and it will not load either. Just zero values showing on the panel gauge.

Is there something else involved that I don't know about?
 
Messages
32
Country
belgium
Anybody?

I can really use some help here. I am compiling the sample in Visual Studio 2008. Are there some kind of settings I need to use?
 

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
How come are you working with the dll.xml instead of the panel cfg for a gauge?
 
Messages
32
Country
belgium
Because that's what the SDK instructions said to do.

And for some reason, some of the default aircraft have no gauges now, which makes no sense to me. I removed all the dll files and cfg file entries, and the Baron 58 and Mooney Bravo have no gauges.

This simulator is really giving me fits.
 
Last edited:

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
The dll.xml is for modules which need to be loaded before an aircraft is even selected and can provide features for any aircraft in the simulator. The panel cfg is for specific gauges. So if you are trying to achieve something for a specific aircraft, you are wasting your time trying to work through the dll.xml.

Secondly, P3D v4 (which I assume you are using since you are trying to do x64) requires VS2015 if you want to make use of SimConnect features. Not necessarily required for pure gauges.h functionality but highly recommended nonetheless. Also, are you using the v4 gauges.h and not the FSX gauges.h?
 

=rk=

Resource contributor
Messages
4,450
Country
us-washington
It seems logical to ascertain a bit about procedure before throwing out advice, but that's just how I roll. A quick scan of the relevant tutorial put things in perspective for me.

https://www.prepar3d.com/SDKv4/sdk/...ort_sample/cabin_comfort_sample_overview.html

So the question

How come are you working with the dll.xml instead of the panel cfg for a gauge?

Can be answered right here:

Edit the dll.xml file. This is in the %APPDATA%\Lockheed Martin\Prepar3D v4 folder. Add the following to dll.xml:
<Launch.Addon>
<Name>Cabin Comfort</Name>
<Disabled>False</Disabled>
<ManualLoad>False</ManualLoad>
<Path>Cabin_Comfort.dll</Path>
<DllStartName>module_init</DllStartName>
<DllStopName>module_deinit</DllStopName>
</Launch.Addon>
Note in particular the use of the DllStartName and DllStopName entries. These are necessary to provide the entry and exit functions to the DLL launch code of Prepar3D. For a description of the rest of the parameters, refer to the DLL.XML section of the SimConnect documentation.

This post

The dll.xml is for modules which need to be loaded before an aircraft is even selected and can provide features for any aircraft in the simulator. The panel cfg is for specific gauges. So if you are trying to achieve something for a specific aircraft, you are wasting your time trying to work through the dll.xml.

Secondly, P3D v4 (which I assume you are using since you are trying to do x64) requires VS2015 if you want to make use of SimConnect features. Not necessarily required for pure gauges.h functionality but highly recommended nonetheless. Also, are you using the v4 gauges.h and not the FSX gauges.h?

Is addressed here:

The Cabin Comfort sample below demonstrates how to link a simple XML definition of a gauge with underlying C++ code. The advantage of this approach is that you can use XML to build most of the gauge (described in the Creating XML Gauges document) and yet access the power and flexibility of a programming language.

and here

NOTE: Data structures linked through the Gauges.h interface must be 4-byte aligned.

RMorrison, the condition JB3DG is trying to confirm here

So if you are trying to achieve something for a specific aircraft, you are wasting your time trying to work through the dll.xml

would be fulfilled by following step four. Are you able to confirm you have completed that step?

4: Either copy the sample panel.cfg file to the SimObjects\Airplanes\Mooney_Bravo\panel folder to add the sample gauge to the Mooney Bravo. Alternatively, to add the gauge to any other aircraft, open up the panel.cfg folder for that aircraft and add the lines shown in the following table:
 
Messages
2,077
Country
us-ohio
I have gauges that I recompiled into 64 bit, but have been unable to load them using the dll.xml file.
The statement above from the OP clearly states they have gauges that they are attempting to load via the dll.xml file. Gauges don't go there. At all. So, the immediate post after the OP is most definitely valid.
 

=rk=

Resource contributor
Messages
4,450
Country
us-washington
Is this really the place to cross analyze someones analysis of a procedure that did not proceed? Let's please not lose sight of the fact that RMorrison is having trouble following a P3D tutorial that clearly instructs him to edit the dll.xml file, so maybe we can try to keep the observations on topic.

So I went to the SDK and compiled the Cabin Comfort sample. Added it to the dll.xml file as instructed:

<Launch.Addon>
......
</Launch.Addon>

and it will not load either. Just zero values showing on the panel gauge.

Is there something else involved that I don't know about?

The relative validity of the second post is completely irrelevant to the OP's stated problem. So unless someone is able to demonstrate something else involved that he doesn't know about that is more direct and accurate than the suggestion to

4. Either copy the sample panel.cfg file to the SimObjects\Airplanes\Mooney_Bravo\panel folder to add the sample gauge to the Mooney Bravo. Alternatively, to add the gauge to any other aircraft, open up the panel.cfg folder for that aircraft and add the lines shown in the following table

one is only adding confusion the OP would probably best be served without.
 

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
Ok FSDevelopers tend be semantic Nazis here lol. A gauge in our lingo is a dll or xml file which is loaded into the sim via the panel cfg. A module (like the Cabin Comfort example) is a dll that gets loaded with the simulator for various purposes that can affect a single, or multiple aircraft.

With that said, if the OP is trying to deal with some gauges that were originally loaded via the panel cfg and has switched to trying to get the Cabin Comfort sample to work in v4, then there is a bit of confusion that needs to be cleared up before we can effectively help him. Also, a little more detail on what he wishes to accomplish will go a long way.
 
Messages
32
Country
belgium
Ok FSDevelopers tend be semantic Nazis here lol. A gauge in our lingo is a dll or xml file which is loaded into the sim via the panel cfg. A module (like the Cabin Comfort example) is a dll that gets loaded with the simulator for various purposes that can affect a single, or multiple aircraft.

With that said, if the OP is trying to deal with some gauges that were originally loaded via the panel cfg and has switched to trying to get the Cabin Comfort sample to work in v4, then there is a bit of confusion that needs to be cleared up before we can effectively help him. Also, a little more detail on what he wishes to accomplish will go a long way.

My first attempt was a gauge that was to be used in just one plane. I compiled it in 64 bit, using the gauges.h that came with the P3d v4 SDK, and then entered it into the dll.xml file, and entered the gauge in a popup window for the Beech Baron.. The gauge was supposed to return one simple integer value. It did not. I removed the gauge and the entry in the dll.xml file, and removed the call in the panel.cfg.

Then I thought just go to basics first, so I compiled the Cabin Comfort sample and the gauges.h, both of which came in the SDK. I entered it into the dll.xml file, and into the Baron panel.cfg file. I placed the dll file into the P3D v4 gauges folder. Just like the SDK instructions. Only zero values show up in the cabincomfort.xml gauge. So I removed the entry to the dll.xml file and made an entry into the gauges.cfg file, like people are discussing. Now No gauges will appear in the Baron, or the Mooney Bravo for that matter. Not even the default ones. I deleted the gauge from the gauges directory, and from the Baron panel.cfg file. And removed the entry from the gauges.cfg file. There are still no gauges in the Baron or Mooney.

This simulator is just giving me fits here.
 
Messages
32
Country
belgium
The dll.xml is for modules which need to be loaded before an aircraft is even selected and can provide features for any aircraft in the simulator. The panel cfg is for specific gauges. So if you are trying to achieve something for a specific aircraft, you are wasting your time trying to work through the dll.xml.

Secondly, P3D v4 (which I assume you are using since you are trying to do x64) requires VS2015 if you want to make use of SimConnect features. Not necessarily required for pure gauges.h functionality but highly recommended nonetheless. Also, are you using the v4 gauges.h and not the FSX gauges.h?

I am not trying to use simconnect. Right now I am just trying to use the SDK Cabin Comfort sample, for testing purposes. I am using the gauges.h that was downloaded in the P3D v4 SDK.
 
Messages
32
Country
belgium
I deleted the gauges.cfg file and let the simulator build a new one, and now the Baron gauges are back. I have no idea why that would make a difference because the text entries inside were the same.
 

=rk=

Resource contributor
Messages
4,450
Country
us-washington
Well, I think I have narrowed your problem down to a formatting issue. If you were unable to manually restore the gauges.cfg, it stands to reason that you were also unable to manually edit the gauges.cfg, does that seem reasonable? So on that basis, if you tried your procedure, being extremely careful to preserve spaces, indents and line separations, I think you'll make some progress.
 
Messages
2,077
Country
us-ohio
1. Entries into the gauges.cfg file should not be done manually. There are command line methods to add additional gauge folders to the sim. To be clear, entries in the gauges.cfg only define paths to folders that contain gauge DLLs. It is used to create additional folders outside of the sim's base gauge folder.
2. Entries into the dll.xml should never be for a gauge DLL. A gauge DLL is not what the dll.xml file is for. The only DLLs that should be added to the dll.xml file are modules that are expected to be loaded by the sim when it starts up a flight.

Until Post #14 there was no mention of changing the content of the gauges.cfg file, so if that was done it would certainly be a potential issue.
I will not discuss the Cabin Comfort project as it is a rather complex tutorial about doing mixed language coding in both C/C++ and the sim's XML syntax for gauges. It can introduce multiple errors by the user simply because of it's complexity. It is not a good choice for a first attempt at gauge coding.
I would like more information regarding the original gauge DLL that the OP was having trouble with:
1. What does the gauge do?
2. How did you install it into the sim?
3. How did you install it into an aircraft?
 
Messages
32
Country
belgium
Well, I think I have narrowed your problem down to a formatting issue. If you were unable to manually restore the gauges.cfg, it stands to reason that you were also unable to manually edit the gauges.cfg, does that seem reasonable? So on that basis, if you tried your procedure, being extremely careful to preserve spaces, indents and line separations, I think you'll make some progress.

The logic makes sense but the reality of it does not. I find it kind of bizarre that adding text as simple as:

[Entry.0]
Title=Default Gauges
Path=Gauges
Required=True
Active=True

Requires much special handling. Anyway, based on the logic it is obvious that this is the case. Just sounds to me like whoever designed this system, where you have text based configuration files that cannot be edited by a text program, leaves much to be desired. In this case, I added an entry, and when everything went south, I used the "Back" function of the text editor to restore it to it's original state. If this caused a problem it tells me that it is in reality not a text based configuration file the way one would normally think of it.

Thanks for the insight on this.
 
Messages
32
Country
belgium
1. Entries into the gauges.cfg file should not be done manually. There are command line methods to add additional gauge folders to the sim.

I guess this relates to the post by =rk=. So these are obviously propitiatory format files and not really text file, where the simulator does not recognize file modifications not made by the simulator. Which to me is nuts, but it is what it is. I do have the SDK instructions for making command line modifications so I will use that from this point on.

To be clear, entries in the gauges.cfg only define paths to folders that contain gauge DLLs. It is used to create additional folders outside of the sim's base gauge folder.
2. Entries into the dll.xml should never be for a gauge DLL. A gauge DLL is not what the dll.xml file is for. The only DLLs that should be added to the dll.xml file are modules that are expected to be loaded by the sim when it starts up a flight.

I am familiar with that distinction from FS X days.

Until Post #14 there was no mention of changing the content of the gauges.cfg file, so if that was done it would certainly be a potential issue.
I will not discuss the Cabin Comfort project as it is a rather complex tutorial about doing mixed language coding in both C/C++ and the sim's XML syntax for gauges. It can introduce multiple errors by the user simply because of it's complexity. It is not a good choice for a first attempt at gauge coding.
I would like more information regarding the original gauge DLL that the OP was having trouble with:
1. What does the gauge do?
2. How did you install it into the sim?
3. How did you install it into an aircraft?

The dll file is a driver for an MFD that is drawn in XML. It is a "mixed language". The Cabin Comfort sample is really pretty simple. It worked fine for me for testing purposes in FS X, by entering it into the dll.xml file. Only difference is it does not work as advertised in the P3D v4 SDK.

The dll I want to make worked fine in FSX. The dll gauge was installed into the FSX\gauges folder and entered into the dll.xml. It was actually a driver that worked for 4 different aircraft projects. This driver simply performs calculation and operations that would be difficult if not impossible to do in XML code. It creates numerical and string values that drive the displays in the MFD XML file.The numerical values are typically passed as 'L' XML values. Strings are passed into XML using 'C' values, like <GaugeString>%((C:SXT:WaypointName,string))%!s!</GaugeString>
 
Messages
2,077
Country
us-ohio
Ok... use the command line functions or the addons.xml method to add your gauge path. Much better behaved.

Lesse... things I can think of that would cause it to not load that's different in 64bit...
1. Security. OS security is a bit tighter in 64bit. I had an issue with code that called GetProcessAffinityMask that would prevent 64bit loading of a DLL.
2. File Access. That falls under security, again.
3. Variable size.
4. The way the DLL is loaded is different in Prepar3D v4 than in FSX. Make certain you're declaring your DLLStart and DLLEnd functions correctly.
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
The logic makes sense but the reality of it does not. I find it kind of bizarre that adding text as simple as:

[Entry.0]
Title=Default Gauges
Path=Gauges
Required=True
Active=True

Requires much special handling.
These .cfg files in P3Dv4 are UNICODE format, meaning when you save from notepad.exe use the UTF-8 format to make them compatible. Note that by default the format is ANSI:
yCeUY.png


Hippopotomonstrosesquippedaliophobia: The Fear Of long Words.
 
Top