windows-mobile-6.1

Windows mobile multitasking is not working perfectly in CF 3.5


Windows mobile multitasking is not working perfectly in CF 3.5. When I run Multitask, remaining functions are not working perfectly.Here is my code

        Thread internetStatusDisplayThread = new Thread(startInternetCheck);
        internetStatusDisplayThread.Start();
          private void startInternetCheck()
          {
           while(isTreadRunning)
           {
            bool internetAvailable = new SecurityManager().IsInternetIsAvailable();
            if (internetAvailable)
            {
                this.Invoke(controlUpdator, noInternetImage, false);
            }
            else
            {
                this.Invoke(controlUpdator, noInternetImage, true);
            }
            internetStatusDisplayThread.IsBackground = true;
            internetStatusDisplayThread.Priority = ThreadPriority.Lowest;

            Thread.Sleep(5000);
           }
          }
        private delegate void InternetStausUpdator(Control uiControl, bool status );

Solution

  • this.Invoke(...); change to this.BeginInvoke(...). Now it is working fine.