Sign in to follow this  
Guest IanK

C vs XML

Recommended Posts

What is the "preferred" method of building gauges - C or XML?XML gauges are newer than C and, to me, appear easier to create than C based on reading the Building Panels and Gauges SDK. I have programmed in C and C++ so my comment isn't based on the difficulties with C. C just looks more complex.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

This question comes up on a regular basis. If you are not a C programmer, try XML first. There are some things you cannot do in XML. C (or C++) gives you access to every feature, very sophisticated logic, and operating system hooks, but the learning curve is very steep. Compounding the issue, the documentation for the panel SDK in C is rather lacking and many items require trial and error and can be frustrating. But, you can do just about anything.Hope this helps,

Share this post


Link to post
Share on other sites

Hi,IMO it depends a bit on what type of gauge you are building; some things are just not possible (or very complex) to program in XML.But in general, I would say that, for a beginner, XML is easier.If only because you don't need a seperate development environment (other then Notepad). And it's just interpreted text, so the development cycle (create - test/debug - adapt ) is very fast.Also, the source can be easily re-used by others (because the gauge is just plain text); on the other hand, you may also call this a disadvantage :-)It's a bit like (V-)Basic vs. C/C++.Main difficulty with XML is the RPN way-of-thinking, especially if you are used to "normal" HighLevel Languages.But no doubt you will see other opinions here :-lolCheers, Rob

Share this post


Link to post
Share on other sites

Opinion... yep.... Rob LOL!!! --- I donot whant to get in a ever remaining thread about what FS10 may be like ( see the general forum for that !!!! ), but i can bet bottom dollar that XML will soon become the de facto gauge language in upcoming versions with full capabilities of the language, such as direct sound manipulation, sgxml ?? ( vectors), .ini read/write etc... As with all previous FS versions MS has given hints of things to come without fully implementing them. But even with XML, a .dll (IE .gau) is needed to to interperet XML into a machine code.Have fun, and do what you know best :-) Regards,Roman(KGRB)

Share this post


Link to post
Share on other sites

Hello everyone,Is it possible to produce gauges in Visual Basic 6?Ian

Share this post


Link to post
Share on other sites

As a practical matter, no. Have a look at the file GAUGES.H in the Panels SDK. You would have to recreate this thing for VB6, as it defines all the functions and data structures required to produce a compiled gauge.Doug

Share this post


Link to post
Share on other sites

Hello Doug,are you saying it is impractical but actually possible?I need advice from an expert incase I would be wasting my time. The SW would not be a problem as it is my day job :-)If not is a C(++) interface between VB6 and FS9 a practical solution?Ian

Share this post


Link to post
Share on other sites

Ian,I should be clear - I am most certainly not an expert. 18 months ago I knew absolutely nothing about creating gauges or about C++. Having said that, in this amateur's mind, you would most certainly be wasting your time trying to produce gauges with VB. As I mentioned previously, that would involve translating most, if not all of GAUGES.H. You really should check this file out, because of course you are the only one who can make the call as to whether moving it over to VB is a waste of your time or not.Now, if you wanted to write a module or stand alone application to work with FS, there is a perfectly good C++ interface available. It's called FSUIPC. It has the ability to read all FS variables and activate FS Key_Events, in addition to being able to read and write to a good deal of other FS data directly. The SDK includes a package for VB programmers. If you took this route, you could come up with something like the Project Magenta package or the 3-Wire carrier operations program.Doug

Share this post


Link to post
Share on other sites

Hello Doug,well that's the other possibility also used in Herve's AFSD program:-)Thanks for the advice.Ian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this