Jump to content
The simFlight Network Forums

FSUIPC SDK C++ Error in Syntax


Recommended Posts

Hi,

first of all I´m new in this forum and I would like to write some small programms for the Flight Simulator 9 with FSUIPC.

I've already dowloaded the FSUIPC SDK. Then I've included the c++ Demo Source into my development environment which is called:

Borland Turbo c++

During Compiling, there appears an error message: "Error in Declarationsyntax".

I've got the impression, that my development environment can't work with the datatyp "DWORD".

Does anybody know this problem or does anybody even have a solution?

Thank you

Andy

Link to comment
Share on other sites

I've got the impression, that my development environment can't work with the datatyp "DWORD".

"DWORD" is just a standard Windows API definition for "unsigned long" or "unsigned int" (in a 32-bit environment both a 32-bit values).

You Borland compiler system should be supplied with a Windows header file for programming Windows programs, otherwise you will have a lot of problems.

You could also download one of the Microsoft FS SDKs, such as that for Panel building -- the "gauges.h" file inside that contains a lot of useful definitions.

Pete

Link to comment
Share on other sites

Hi,

thanks for answering quickly.

I included the "GAUGES.H" File into my Project.

But the old Error still exists.

A second Error-Message appears: "'DWORD' is declared several times"

It is also declared in "windef.h".

Now I don't know what to do.

Thank You

Andy

Link to comment
Share on other sites

I included the "GAUGES.H" File into my Project.

But the old Error still exists.

A second Error-Message appears: "'DWORD' is declared several times"

It is also declared in "windef.h".

Now I don't know what to do.

Oh, are you new to C/C++? If so, might not Visual Basic be a better place to start? You will at least need to read up a bit more I think.

If you are including Windef.h, how are you getting it undefined in the first place? Just delete your inclusion of Gauges.h. I wasn't suggesting you included the gauges header wholesale -- after all 99% is no use to you. i was only suggesting that if you didn't know what something like DWORD meant you could easily find out by just looking! These header files are TEXT files you know, you can read them, take bits out, make your own header, as you please. This is all part of what is known as "programming". ;-)

In the end, if you didn't want to use DWORD you could use "unsigned int" as I suggested, or #define DWORD for yourself. You seem to be making a real meal out of a tiny snack! :-(

Pete

Link to comment
Share on other sites

Hi Pete,

thanks for your quick answer.

Since 1 year I´m programming with C++ in the school. But I do my best ;)

The first probelm is cleared. I changed the developement environment to Borlad C++ Builder 6.

The DWORD probelm disappears, it had to disappear.

But now I've got a linker error.

I don´t know why. I did all steps from the README-File.

I insered the LIB and Header file into my source folder

I included the header in my source module(s)

and I added the Lib to my Project.

The Error-Message says:

[Linker Error] 'Path\FSUIPC_USER.lib' contains ivalid OMF record, type 0x21 (possibly COFF)

Does I have to include a DLL-File or do you know what is wrong?

Thank You

Andy

Link to comment
Share on other sites

The Error-Message says:

[Linker Error] 'Path\FSUIPC_USER.lib' contains ivalid OMF record, type 0x21 (possibly COFF)

No idea about that, except that possibly Microsoft C LIB files aren't compatible with Borland.

But that should be no worry for you -- the source of the LIB is provided as well. Why not build your own with borland?

Incidentally, I just looked in side the FSUIPC SDK and I see there's an example package for Borland in any case. Did you ever bother to look at that? It is listed in the READ ME as follows:

UIPC_SDK_BCB5.zip

This is a version of the C example code revised and compiled

with Borland C++ Builder 5: supplied by Alan Dyer.

Does I have to include a DLL-File or do you know what is wrong?

No DLL. It seems it is Borland which is wrong, really. But everything is supplied, you aren't missing anything. The tools are there, you simply need to use them.

Pete

Link to comment
Share on other sites

Hi,

because of my problem: Also the Linker-problem is clear. I couln't find the package for the Borland Builder, just the normal C package.

But because of your answer I found it. Now I can use the Functions. The read and write functions works well.

But now I would like to read out the current position( longitude, latitude) and set a new one.

But when I read out the Position of an Airport, the coordinates departs from the real out of a text-file.

I give you an example:

Current Airport: KSEA

Runway: 34R

longitude: -122,307860

latitude: 47,447317

longitude read out by FSUIPC: -122,307998333126

latitude read out by FSUIPC: 47,4314848334006

I did this "query" as you've written in your SDK-Folder.

So is this a probelm with rounding? Or do you know more?

Thanks,

Andy

Link to comment
Share on other sites

But when I read out the Position of an Airport, the coordinates departs from the real out of a text-file.

You cannot read the "position of an airport", only the position of the user aircraft.

What "text file" are you using? What is this "text file" giving you the position of?

I give you an example:

Current Airport: KSEA

Runway: 34R

longitude: -122,307860

latitude: 47,447317

longitude read out by FSUIPC: -122,307998333126

latitude read out by FSUIPC: 47,4314848334006

The difference here is 0.0001 longitude by .016 latitude. 1 degree Latitude = 60nm, so the difference you are complaining about is less than 1 nm (0.016 x 60 = 0.96). The runway is probably 2 miles long -- so where on that runway are you trying to find the position? It could be 2 miles different from one end to the other!!

Please try to use some common sense. I have no idea where your source data is (this "tecxt file") but if you want positions in FS you have to read positions in FS, not is some other source!

Use Shift+Z in FS and display the Lat/Lon of the aircraft on screen.

Pete

Link to comment
Share on other sites

You cannot read the "position of an airport", only the position of the user aircraft.

What "text file" are you using? What is this "text file" giving you the position of?

My target is to write a program for my cockpit without using the menus of the FS. On this program I want to set my aircraft to an airport and there on a runway. It should be like a small instructor station. So I have to know the position (longitude, latitude, altitude, heading) of each runway in FS. I read out this data with the program "Super FlightPlanner" which generates a database of all these datas from FS and allows to export this data to a csv-file.

Here an example how this file looks:

This is just the header:

"AirportId";"RunwayId";"Lat";"Lon";"Alt";"Heading";"Surface";"Length";"Width"

These are the data:

"KSEA";"16L";47,447317;-122,307860;428;180,34;"ASPHALT";11893;149

"KSEA";"34R";47,447317;-122,307860;428;180,34;"ASPHALT";11893;149

"KSEA";"16R";47,450699;-122,311069;428;180,34;"CONCRETE";9419;149

"KSEA";"34L";47,450699;-122,311069;428;180,34;"CONCRETE";9419;149

You can imagine that it is really important for me that the aircraft has exactly the position on the runway.

Use Shift+Z in FS and display the Lat/Lon of the aircraft on screen.

Yes, I use this information. for KSEA 34R it is N47 25.89' W122 18.48'

Maybe you can explain me how I can calculate from the coordinates above (N47 25.89' W122 18.48') to that one which gives FSUIPC if I read out the position (long/lat) from my aircraft on KSEA 34R. So it will be easier for me to check and complain the data with the information read out from the FS by SuperFlightPlanner (text-file). Well I think you have more knowledge in this material then anyone else so I hope you can help me and understand my problem.

Andy

Link to comment
Share on other sites

So I have to know the position (longitude, latitude, altitude, heading) of each runway in FS. I read out this data with the program "Super FlightPlanner" which generates a database of all these datas from FS and allows to export this data to a csv-file.

My own freeware program "MakeRunways" does this too. It can provide the latitude and longitude of the runway centre and each threshold.

Use Shift+Z in FS and display the Lat/Lon of the aircraft on screen.

Yes, I use this information. for KSEA 34R it is N47 25.89' W122 18.48'

Where on 34R? The threshold, in the centre of the runway? It is important to say WHERE on the runway. They are quite long and often wide, you know.

N47 25.89 is, in degrees, +47.4315

W122 18.48 is, in degrees, -122.3080

These are, to the accuracy of the Shift+Z display, IDENTICAL to the values you got from FSUIPC:

ongitude read out by FSUIPC: -122,307998333126

latitude read out by FSUIPC: 47,4314848334006

The only difference is that the FSUIPC values are much, much more accurate. To the inch.

Maybe you can explain me how I can calculate from the coordinates above (N47 25.89' W122 18.48') to that one which gives FSUIPC if I read out the position (long/lat) from my aircraft on KSEA 34R.

They will be identical -- though the readout from FSUIPC will be much more accurate (to a few inches in fact). Both the Shift+Z readout and the FSUIPC readout use exactly the same data.

To convert Degrees and minutes to just decimal Degrees just divide the minutes value by 60 to get the fraction (there are 60 minutes in each degree, as you must know). So

47 25.89 = 47 + (25.89/60) = 47.4315 and

122 18.48 = 122 + (18.48/60) = 122.3080 (then negated as FS treats West as -ve, East as +ve).

Pete

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.