Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Catastrophic failure while running thread with BackgroundWorker

Catastrophic failure while running thread with BackgroundWorker

Scheduled Pinned Locked Moved WPF
helpquestionworkspace
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    salon
    wrote on last edited by
    #1

    I am running some threads so that data initially gets loaded partially and then with the threads, the should get loaded at runtime. But if I close the browser and the thread is not get completed at a certain point then it throws following error: System.Exception was unhandled by user code Message="Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))" StackTrace: at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.CreateObjectByTypeIndex(UInt32 typeIndex) at System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex, IntPtr constructDO) at System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex) at System.Windows.UIElement..ctor(UInt32 nKnownTypeIndex) at System.Windows.FrameworkElement..ctor(UInt32 nKnownTypeIndex) at System.Windows.Controls.Control..ctor(UInt32 nKnownTypeIndex) at System.Windows.Controls.UserControl..ctor() at ReeleezeeFormsEngine.Silverlight.CommonControls.Pager..ctor(String sectionCount) at ReeleezeeFormsEngine.Silverlight.FormsRenderer.AutoLayoutGridManager..ctor(AutoLayoutGridManagerConfiguration configuration, String sectionCount) at ReeleezeeFormsEngine.Silverlight.FormsRenderer.SequentialRenderer.backgroundWorkerForSection_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e) at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e) at System.ComponentModel.BackgroundWorker.<OnRun>b__1(Object state) InnerException: I am using BackgroundWorker for threading?

    V 1 Reply Last reply
    0
    • S salon

      I am running some threads so that data initially gets loaded partially and then with the threads, the should get loaded at runtime. But if I close the browser and the thread is not get completed at a certain point then it throws following error: System.Exception was unhandled by user code Message="Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))" StackTrace: at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.CreateObjectByTypeIndex(UInt32 typeIndex) at System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex, IntPtr constructDO) at System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex) at System.Windows.UIElement..ctor(UInt32 nKnownTypeIndex) at System.Windows.FrameworkElement..ctor(UInt32 nKnownTypeIndex) at System.Windows.Controls.Control..ctor(UInt32 nKnownTypeIndex) at System.Windows.Controls.UserControl..ctor() at ReeleezeeFormsEngine.Silverlight.CommonControls.Pager..ctor(String sectionCount) at ReeleezeeFormsEngine.Silverlight.FormsRenderer.AutoLayoutGridManager..ctor(AutoLayoutGridManagerConfiguration configuration, String sectionCount) at ReeleezeeFormsEngine.Silverlight.FormsRenderer.SequentialRenderer.backgroundWorkerForSection_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e) at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e) at System.ComponentModel.BackgroundWorker.<OnRun>b__1(Object state) InnerException: I am using BackgroundWorker for threading?

      V Offline
      V Offline
      Viral Upadhyay
      wrote on last edited by
      #2

      if your browser is close where you got error?

      Viral My Site Tips & Tracks

      S 1 Reply Last reply
      0
      • V Viral Upadhyay

        if your browser is close where you got error?

        Viral My Site Tips & Tracks

        S Offline
        S Offline
        salon
        wrote on last edited by
        #3

        I have one button added each time when the thread gets completed for each time. It means if it brings one chunk of data in one thread then one button added, then it brings another chunk then another button added, brings third chunk third button added, brings fourth chunk fourth button added and so on..... But in between if we close the browser then exception occurs at the constructor of button control

        V 1 Reply Last reply
        0
        • S salon

          I have one button added each time when the thread gets completed for each time. It means if it brings one chunk of data in one thread then one button added, then it brings another chunk then another button added, brings third chunk third button added, brings fourth chunk fourth button added and so on..... But in between if we close the browser then exception occurs at the constructor of button control

          V Offline
          V Offline
          Viral Upadhyay
          wrote on last edited by
          #4

          I dont understand you problem clearly but, It seem to me that you have problem when your application close. Make sure you close all your thread at application close event. Viral

          Viral My Site Tips & Tracks

          S 1 Reply Last reply
          0
          • V Viral Upadhyay

            I dont understand you problem clearly but, It seem to me that you have problem when your application close. Make sure you close all your thread at application close event. Viral

            Viral My Site Tips & Tracks

            S Offline
            S Offline
            salon
            wrote on last edited by
            #5

            How can i close all the threads before closing the window?

            S 1 Reply Last reply
            0
            • S salon

              How can i close all the threads before closing the window?

              S Offline
              S Offline
              salon
              wrote on last edited by
              #6

              I got a link http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.cancellationpending%28VS.95%29.aspx[^] I have written

              if ((worker.CancellationPending == true))
              {
              e.Cancel = true;

                  }
              

              in bw_DoWork(object sender, DoWorkEventArgs e) but still getting the same exception. I think this is because bw_DoWork not getting that the browser is getting closed. How can I tell it that? Do I have some flag so that it is conveyed to this event that browser is getting closed?

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups