1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

P3D v4 Gauge loading in P3d v4

Discussion in 'Prepar3D' started by RMorrison, 2 Dec 2017.

  1. RMorrison

    RMorrison

    Joined:
    24 Apr 2013
    Messages:
    14
    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?
     
  2. RMorrison

    RMorrison

    Joined:
    24 Apr 2013
    Messages:
    14
    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?
     
  3. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,116
    Country:
    southafrica
    How come are you working with the dll.xml instead of the panel cfg for a gauge?
     
  4. RMorrison

    RMorrison

    Joined:
    24 Apr 2013
    Messages:
    14
    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: 6 Dec 2017
  5. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,116
    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?
     
  6. =rk=

    =rk=

    Joined:
    28 Nov 2009
    Messages:
    1,667
    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

    Can be answered right here:

    This post

    Is addressed here:

    and here

    RMorrison, the condition JB3DG is trying to confirm here

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

     
  7. WarpD

    WarpD

    Joined:
    9 Dec 2007
    Messages:
    965
    Country:
    us-ohio
    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.
     
  8. =rk=

    =rk=

    Joined:
    28 Nov 2009
    Messages:
    1,667
    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.

    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

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

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,116
    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.
     
  10. =rk=

    =rk=

    Joined:
    28 Nov 2009
    Messages:
    1,667
    Country:
    us-washington
  11. RMorrison

    RMorrison

    Joined:
    24 Apr 2013
    Messages:
    14
    Country:
    belgium
  12. RMorrison

    RMorrison

    Joined:
    24 Apr 2013
    Messages:
    14
    Country:
    belgium
    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.
     
  13. RMorrison

    RMorrison

    Joined:
    24 Apr 2013
    Messages:
    14
    Country:
    belgium
    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.
     
  14. RMorrison

    RMorrison

    Joined:
    24 Apr 2013
    Messages:
    14
    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.
     
  15. =rk=

    =rk=

    Joined:
    28 Nov 2009
    Messages:
    1,667
    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.
     
  16. WarpD

    WarpD

    Joined:
    9 Dec 2007
    Messages:
    965
    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?
     
  17. RMorrison

    RMorrison

    Joined:
    24 Apr 2013
    Messages:
    14
    Country:
    belgium
    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.
     
  18. RMorrison

    RMorrison

    Joined:
    24 Apr 2013
    Messages:
    14
    Country:
    belgium
    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.

    I am familiar with that distinction from FS X days.

    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>
     
  19. WarpD

    WarpD

    Joined:
    9 Dec 2007
    Messages:
    965
    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.
     
  20. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,837
    Country:
    unitedstates
    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:
    [​IMG]

    Hippopotomonstrosesquippedaliophobia: The Fear Of long Words.