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 8573167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:11:19+00:00 2026-06-11T19:11:19+00:00

I’ve got a program which is doing some geometrical analysis in a background thread.

  • 0

I’ve got a program which is doing some geometrical analysis in a background thread.

Usually this worked quite well, but surprisingly now I get an exception when trying to create a PathGeometry on my development computer:

So on the simple code:

PathGeometry geometry = new PathGeometry();

I get an System.TypeInitializationException {“Der Typeninitialisierer für \”System.Windows.Media.PathGeometry\” hat eine Ausnahme verursacht.”}
Stack Trace is:

bei System.Windows.Media.PathGeometry..ctor()
bei Bsoft.ilka.AlkisLeser.AlkisDatei.GetPosition(XElement xe) in AlkisDatei.cs:Zeile 267.

This exception contains the InnerException System.ComponentModel.Win32Exception {“Ungültiges Fensterhandle”}
Stack trace of the InnerException is:

bei MS.Win32.UnsafeNativeMethods.GetWindowLongWndProc(HandleRef hWnd)
bei MS.Win32.HwndSubclass.UnhookWindowProc(Boolean force)
bei MS.Win32.HwndSubclass.Dispose()
bei MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
bei System.Windows.Threading.Dispatcher..ctor()
bei System.Windows.Threading.Dispatcher.get_CurrentDispatcher()
bei System.Windows.DependencyObject..ctor()
bei System.Windows.Media.PathFigureCollection.get_Empty()
bei System.Windows.Media.PathGeometry..cctor()

Strange thing: The executable does work on some other computer.

What is the problem? Why does the PathGeometry constructor try to access some window handle? How do I resolve this?

I’m using .NET framework 4.0 and the code throws on both VS2010 and VS2012.

  • 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-11T19:11:20+00:00Added an answer on June 11, 2026 at 7:11 pm

    You’ll get this stack trace when the native CreateWindowEx() api function call fails. There are very few reasons for it to fail, but one. It is likely your program suffers from a handle leak, consuming 10,000 window handles. At which point Windows refuses to let you create more.

    Diagnose with Taskmgr.exe, Processes tab. View + Select columns, tick USER Objects. Also tick Handles and GDI Objects, just in case. Observe the displayed values for your process. A steadily climbing value for USER Objects spells doom. Finding the cause of the leak can be a bit difficult. Certainly consider a memory profiler. Arbitrarily comment out chunks of code. If you don’t see the leak in Taskmgr.exe then there’s some kind of other process messing with yours. Arbitrarily kill them one by one to find the troublemaker.

    Last but not least, seeing a worker thread creating a window is a recipe for trouble. I don’t know enough about PathGeometry but it certainly doesn’t look like the kind of class that could function correctly on a worker.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.