Jump to content
Sign in to follow this  
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

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

That example has been around since FS2002.


Ed Wilson

Mindstar Aviation
My Playland - I69

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

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...