Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7128357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:07:49+00:00 2026-05-28T11:07:49+00:00

I am currently using two XBees, one of them attached to my computer, and

  • 0

I am currently using two XBees, one of them attached to my computer, and the other on a homemade UAV. The Xbee on the plane is constantly sending data about about the plane, and I want to get that data using my C++ interface – a Form (I believe they’re also called WinForms?). My form has a webBrowser in it that has Google Earth embedded, and I want to update the plane’s location on the GE map. I know how to get the data from the XBee, but I just don’t know how to get the code that gathers the data to execute constantly without input.

This project was someone else’s who dropped it. I “inherited” this code, and it’s a bit confusing to me due to lack of comments.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:07:49+00:00Added an answer on May 28, 2026 at 11:07 am

    You can change your message pump to use PeekMessage() instead of the usual GetMessage(). This will allow you to process messages if any are available or do something else while the message loop is idle.

    When using the Win32 API, it looks something like:

    for (bool running = true; running; )
    {
        // check for any window messages.  this operation does not block
        // if no messages are available.
        ::MSG message;
        const ::BOOL fetched = ::PeekMessage(&message, 0, 0, 0, PM_REMOVE);
        if (fetched)
        {
            // process window message.
            TranslateMessage(&message);
            DispatchMessage(&message);
    
            // need to check explicitly for WM_QUIT message, since the "false"
            // return value is already used to mean "there were no messages".
            running = (message.message != WM_QUIT);
        }
        else
        {
            // no messages available, thread is idle.  take time to check
            // auxiliary input source.  if no auxiliary input is available
            // and checking (and processing) the auxiliary inputs is very
            // fast, consider adding an extra ::Sleep() call to avoid hogging
            // up the CPU.
        }
    }
    

    For .NET based applications, you might want to take a look at the Application.Idle event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently using two redis nodes where one is replicating another. Other than
I am currently using two .htaccess files for my website: one is the development
I am currently using two forms in my rails app, one for a contact
I'm currently developing an app that uses Core Data. I'm using two stores/configurations, one
I'm currently using two libraries (prototype and jQuery), thus I've implemented the jQuery noConflict
I am currently using two catch blocks after a try block. The first catches
I currently am using two stylesheets to get my intended output. The first stylesheet
I have an application in which I'm currently using a two column table in
Currently using Xcode 4.2 and I have two view controllers (1 and 2). I
I am currently using Symfony2 and Doctrine2 and am trying to join two tables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.