Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

itrafficinfo examples needed

Featured Replies

Hi all,I am trying to make a simple radar screen showing AI around the aircraft. Does anyone know of a tutorial or some reference material of any kind that could help me work with the Traffic Toolbox and itrafficinfo? Like a basic example of source code to start from.I am using VC++ 2005 for this btw, the rest of the gauges are in XML though. Haven't coded gauges in C for two years so a little rusty... ;) Cheers,Thomas

  • Replies 47
  • Views 5.2k
  • Created
  • Last Reply

Top Posters In This Topic

>Hi all,>>I am trying to make a simple radar screen showing AI around>the aircraft. Does anyone know of a tutorial or some reference>material of any kind that could help me work with the Traffic>Toolbox and itrafficinfo? Like a basic example of source code>to start from.>>I am using VC++ 2005 for this btw, the rest of the gauges are>in XML though. Haven't coded gauges in C for two years so a>little rusty... ;) >>Cheers,>Thomas>>There's a C++ tutorial in the FS2004 Panels.sdk , 'ItrafficInfo.doc' file.Just follow the steps in that example, it seems to work fine.Regards.Ernie.

ea_avsim_sig.jpg

Thanks Ernie!Yes I knew about the sample code in the SDK, but making it work for me is another thing... I am obviously doing something wrong. That is why I was looking for more code examples.I use VC++ 2005 Express. Having successfully compiled other gauges with this setup, I now get the following compiling errors: V:gaugesinc..incITrafficInfo.h(9) : error C2061: syntax error : identifier 'ITrafficInfo' V:gaugesinc..incITrafficInfo.h(9) : error C2059: syntax error : ';' V:gaugesinc..incITrafficInfo.h(9) : error C2059: syntax error : ':'What could be the problem here? Thanks /Thomas

  • 10 months later...

Hi, I'm getting the same errors when I try to compile a gauge using trafficInfo functions and I was wondering if you ever found out how to correct it. Thanks,Eric

  • Moderator

Where are you #define'ing itrafficinfo.h file???This is the format I use for all gauges that require itrafficinfo.h file. This is in the main .cpp file for the project:#include "..incfs9gauges.h"#include #include #define ULONG_PTR DWORD#define UNICODE#include using namespace Gdiplus;#include "MyGauge.h"#include "..incgpsprop.h"#include "..incacparams.h"#include "..incitrafficinfo.h"

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • 1 month later...

Thanks Bill! I actually managed to solve the error myself since I started this topic some months ago. The header file was messed up, by me as usual. Mea culpa.My C/C++ programming skills are still very rusty, since I make everything in XML these days. So to avoid wasting everybody's time I was looking for some complete samples to get me started, e.g. printing data for the nearest 20 aircraft as strings. Unlike most people, I have some difficulties understanding the SDK...So thanks anyway, but now it's back to "C++ for morons" I guess.Cheers /ThomasProud father of the J 35J Draken for FS2004http://flightsim.bookmark.se

I have a source example for a DLL in the pipeline where I program a radar screen for use with XML and C gauges, with ITrafficInfo and GDI+. Actually my "old" RadarGauge as DLL for XML usage.Anyone interested?

Very interested Arne! Been working on the same thing as it turns out. Might save me a ton of coding.Thanks!Doug

Me too! Me too! ;o) Something like that would really save the day. Thanks /Thomas

I attached the source, the dll and a XML example. The real hindrance for uploading in the library is of course the dreaded monster named documentation.

Amazing Arne! There will be a statue of you someday I am sure. This saves us mortals some weeks of trial-and-error coding.A zillion thanks /Thomas

Just tried implementing this in my (still experimental) xml radar gauge. Works like a charm. One question to Arne: the blips have a dark (1,1,1?) edge, is there any way to change that color to fit another bg? I use a vector drawn circle as bg and not a bitmap btw. /Thomas

Use a dark background, then you don't see it. Or no transparancy. It's a problem with the antialiasing and the use of RGB(0,0,0) for transparency by FS. Since the RGB(0,0,0) background is somewhat smeared out with the drawn pixels, you end with some pixels above RGB(0,0,0) and therefore darker as the normal pixels, but intransparent. So either use a dark background, or for transparent drawings remove the Antitaliasing command in the GDI-drawing.... //make all drawings antialiased// m_graphics->SetSmoothingMode(SmoothingModeAntiAlias);...I'm not sure if that helps.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.