Archived

This topic is now archived and is closed to further replies.

WarpD

Update GPS flight plan

Recommended Posts

My goal is to update the GPS flight plan (add, remove waypoints) using C++ code. I used the code sample of the SDK as a base, and I coded a very simple piece of code that is supposed to update the existing flight plan with THE SAME flight plan.The code looks like this:gpsrequest->dwUpdateRequest = 2;gpsrequest->vPosition = gpsinfo->vPosition;gpsrequest->bIsFlightPlanAvailable = TRUE;gpsrequest->bIsDirectTo = FALSE;gpsrequest->lNextWp = gpsinfo->lNextWp;gpsrequest->lWpCounts = gpsinfo->lWpCounts;for (UINT32 i=0; i < gpsrequest->lWpCounts; i++) gpsrequest->pWpData = gpsinfo->pWpData;As you can see, the 'gpsrequest' structure is the mirror of the 'gpsinfo' structure that describes the current flight plan. When this code is executed, the flight plan is still there, but all the waypoint names have disappeared !!Do you know why?Do you know how I can edit the existing flight plan without loosing the waypoint names?Any info is welcome !!Eric

Share this post


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

Interesting...In this case, I wonder why Microsoft has provided this code sample in the SDK. But it is not the first time Microsot takes us on an a way that leads nowhere...Eric

Share this post


Link to post
Share on other sites

Do you mean the example was working in FS2002 and it doesn't work in FS2004? This would be surprising... The GPS system has not changed much between FS2002 and 2004.But who cares? The fact is that the code doesn't work, that's it.Eric (disappointed)

Share this post


Link to post
Share on other sites

I can also say the code that lets you READ the GPS flight plan is from FS2002 and it still works perfect, even with FSX...

Share this post


Link to post
Share on other sites