Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF HwndWrapper COM exception within WCF threads

$
0
0

Hello Folks,

I have a curious issue that is causing me a lot of headaches.  I am creating a rectangle geometry in a server (wcf) thread.  I do this by using the following code:

...

     RectangleGeometry rectangleGeometry = new RectangleGeometry();

      rectangleGeometry.Rect = new System.Windows.Rect(reportLabel.BoundRectOrg.X, reportLabel.BoundRectOrg.Y, reportLabel.BoundRectOrg.Width, reportLabel.BoundRectOrg.Height);
...

If this code runs for a long time along side everything else the server does, I eventually start getting an exception in the constructor:

2013-03-04 16:29:54.7563 FodServer.FodDB.CFodTbl.TraceException Exception occured System.ComponentModel.Win32Exception (0x80004005): The operation completed successfully
   at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
   at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
   at System.Windows.Threading.Dispatcher..ctor()
   at System.Windows.Threading.Dispatcher.get_CurrentDispatcher()
   at System.Windows.Media.RectangleGeometry..ctor()
   at ...

Note that this server is a service and has no windows to speak of.  It uses just the system.windows.media geometries and the xaml writer in another section of code.  Nothing is ever rendered to the screen.

This feels like a memory leak but I can't find anything.  Does anybody have any suggestions how to fix this issue?


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>