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

XML with underlying C++ code tutorials?

Messages
13
Country
us-california
Heya guys and thanks for reading,

I been working on a panel for a while now in XML with all the logic being driven by c++. This was my first adventure at building anything for FSX so it started off very sloppy. On the c++ side, I started off with a microsoft example and modified it to see how everything works. Now that I got a grasp on how it works, I am attempting to clean up everything and running into nightmares and would like to build one up from scratch instead.

Long story short, is thier a basic tutorial or template for creating a VS c++ project that outputs a dll for XML communication for panel creation? At the moment, I don't need to pull anything from FSX, just sending simple intergers back and forth from XML and c++. Through my search, I see many templates, examples, and tutorials for pure c++ gauges or xml guages but not much for a combination such as the Cabin Comfort example MS provides. I appologize if this is answered in depth somewhere that I could not find and thanks in advance.
 
Exactly what I was looking for. Don't know why I couldn't find it. Thanks so much Bill :-)

No problem at all. Keep in mind that all XML (L:variable) types are FLOAT64 or double types in C.

The units used in XML script for them are for ease of human reading and understanding only... ;)
 
FontColor changing with variables?

I have made a lot of progress but I ran accross another issue that I hope that I can work around.

for controling visibility in some of my display areas, I have been controling it with c++ and been accessing it from XML like this and it works flawlessly

<Visibility>(C:COMM:MainWindowVisible,enum)</Visibility>

I been accessing strings from c++ like this with no issues
<GaugeString>%((C:COMM:MainDisplay))%!s!</GaugeString>

The last thing that I wanted to do but is throwing a hugh headache is dynamically control the font colors of the main display within my functions in c++ and have XML access it like I have done everything else. So I assumed that it would be like this

<FontColor>(C:COMM:TextColor,string)</FontColor>

but it didn't work. I am assuming that my problem is from my lack of XML experience :-). Is it possible to control such setting with variables? Thanks again.
 
We cannot even have dynamic font color control working strictly within XML either...

You will either need to have separate <Element>s for color control, or use <FormattedText> with alternate colors instead.
 
I was afraid that was what you were going to tell me :-(. I will have to go the seperate Elements route. I can see that this XML file is going to be huge when I am done :-)

You are insanely fast at replying Bill I really appreciate that! Thanks again for the clarification.
 
Note that separate Elements that rely on Visibility commands to appear/disappear to change the text's color will sometimes not work in FSX, but will work OK in FS9.
 
Back
Top