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

  • Home
  • SEARCH
  • 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 8494455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:18:12+00:00 2026-06-10T23:18:12+00:00

I am working on a Silverlight for Windows Embedded project and running into a

  • 0

I am working on a Silverlight for Windows Embedded project and running into a problem with my UI thread. Currently the application UI thread must continually update its display based on data stored in a shared memory file and then sleep for a specified number of milliseconds before updating the UI once again. So in essence the code is something like the following:

while(true){
    UpdateUI();    //gets data from shared memory and updates graphics
    Sleep(250);
}

However, as I am sure some of you know, it is not recommended to use Sleep() within the main Silverlight UI thread. Sure enough, my entire embedded system will crash after running for 20-30mins and I have identified the call to Sleep() as the issue.

What I need is an alternative method to update the UI, pause for some amount of time, and then update the UI again, repeating this process ad infinitum.

As far as I am aware, the embedded nature of the project does not allow me to use some of the obvious alternatives to Sleep() that would be a better solution in the UI thread (i.e. Join()).

Any suggestions would be greatly appreciated!

  • 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-06-10T23:18:14+00:00Added an answer on June 10, 2026 at 11:18 pm

    A timer is a far better route then a loop, especially a loop with a Sleep in the UI thread. A simple call to SetTimer or timeSetEvent is probably what you’re after.

    int WinMain(...)
    {
        // initialize xamls stuff
    
        // start a timer
        SetTimer(0, 0, 250, TimerProc);
        // *OR*
        timeSetEvent(250, 0, EventProc, NULL, TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
    
        // call StartDialog or whatever to launch your UI
    }
    
    void CALLBACK TimerProc(HWND hwnd, UINT, UINT, DWORD dwTime)
    {
        // this will get called every 250ms    
        UpdateUI();
    }
    
    void CALLBACK EventProc(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
    {
        // this will get called every 250ms    
        UpdateUI();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I am working on getting system information via a Silverlight Embedded Application tied
I'm currently working on the UI of a Silverlight application and need to be
I am working with a Silverlight business application that is using Windows Authentication. When
I am working on a Silverlight based Windows Phone application that only supports landscape
Hi I have a problem when I am working on my Windows Phone silverlight
I am currently working on a windows phone project where i have test the
I'm working on a windows phone 7 application which uses Silverlight. What I'm looking
I'm working on a windows phone 7 project, with silverlight, and i'm trying to
I am currently using the ExpressionDark theme in a Silverlight project I am working
I am working on a Silverlight application, and I want to bind the simple

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.