Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
System.ComponentModel.Win32Exception: The operation completed successfully
posted
Hi,
 
   I'm calling a .Net 1.1 Infragistics calender windows control (32 bit) from an aspx page (old code) in Windows 2008 Server R2 (with WOW64) . This control was working on all operating systems including Windows 7 and when loaded in Windows 2008 Server R2 it throws up the exception given below.
I'm able to load the control sometimes, say 5% successful (only the first time when I load the application) and the remaining 95% it throws up the exception dialog box (sometimes it happens when I load the application for the first time too).

I've also attached the image of the dialog box that contains the following error meesage.

--------------------------------------------------------------------------------------------------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ComponentModel.Win32Exception: The operation completed successfully
   at System.Drawing.BufferedGraphicsContext.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits)
   at System.Drawing.BufferedGraphicsContext.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height)
   at System.Drawing.BufferedGraphicsContext.AllocBuffer(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
   at System.Drawing.BufferedGraphicsContext.Allocate(IntPtr targetDC, Rectangle targetRectangle)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
CustomCalendar
    Assembly Version: 860.1.1.1
    Win32 Version: 860.1.1.1
    CodeBase: file:///C:/Program%20Files%20(x86)/ClientApplication/CustomCalendar.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Infragistics.Win.v4.3
    Assembly Version: 4.3.20043.27
    Win32 Version: 4.3.20043.27
    CodeBase: file:///C:/Program%20Files%20(x86)/ClientApplication/Infragistics.Win.v4.3.DLL
----------------------------------------
Infragistics.Shared.v4.3
    Assembly Version: 4.3.20043.27
    Win32 Version: 4.3.20043.27
    CodeBase: file:///C:/Program%20Files%20(x86)/ClientApplication/Infragistics.Shared.v4.3.DLL
----------------------------------------
WebApplication.API
    Assembly Version: 860.1.1.1
    Win32 Version: 860.1.1.1
    CodeBase: file:///C:/Program%20Files%20(x86)/ClientApplication/WebApplication.API.DLL
----------------------------------------
ApplicationUtilities
    Assembly Version: 860.1.1.1
    Win32 Version: 860.1.1.1
    CodeBase: file:///C:/Windows/assembly/GAC/ApplicationUtilities/860.1.1.1__5321fb4a87e940e2/ApplicationUtilities.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Microsoft.mshtml
    Assembly Version: 7.0.3300.0
    Win32 Version: 7.0.3300.0
    CodeBase: file:///C:/Windows/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
----------------------------------------
Infragistics.Win.UltraWinSchedule.v4.3
    Assembly Version: 4.3.20043.27
    Win32 Version: 4.3.20043.27
    CodeBase: file:///C:/Program%20Files%20(x86)/ClientApplication/Infragistics.Win.UltraWinSchedule.v4.3.DLL
----------------------------------------
Infragistics.Win.Misc.v4.3
    Assembly Version: 4.3.20043.27
    Win32 Version: 4.3.20043.27
    CodeBase: file:///C:/Program%20Files%20(x86)/ClientApplication/Infragistics.Win.Misc.v4.3.DLL
----------------------------------------
System.Web.Services
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
ajotsfos
    Assembly Version: 860.1.1.1
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
ApplicationObject
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/ClientApplication/ApplicationObject.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

--------------------------------------------------------------------------------------------------------------------

After some investigation I tried the following two techniques to solve this issue but couldn't fix it

Technique 1
 --------------
According to this link http://nomagichere.blogspot.com/2008/03/systemcomponentmodelwin32exception-is.html
we should always dispose CreateGraphics() object everytime we call it. But i checked my code and we did dispose all the objects correctly. Even if its not disposed this error should also happen in Windows 7, but it only happens in Windows 2008 Server R2 (64 bit)

Technique 2
 --------------
I thought that it could be related to the aspnet worker process (64 bit) trying to run the control (32 bit), so i tried the following command.

CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

 No change after running this command too.

This issue is blocking everything. Appreciate any ideas or fixes.

Thanks
Parents
No Data
Reply
  • 105
    posted

    Did you ever resolve this?  I'm on 10.3 and getting the same thing:

    System.ComponentModel.Win32Exception was unhandled by user code
      Message=The operation completed successfully
      Source=System.Drawing
      ErrorCode=-2147467259
      NativeErrorCode=0
      StackTrace:
           at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
           at System.Drawing.Graphics.CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize)
           at Infragistics.Win.ControlUIElementBase.CaptureOldImage(UIElement element)
           at Infragistics.Win.TransitionInfo..ctor(UIElement element, Transition transition, TransitionSettings settings)
           at Infragistics.Win.ControlUIElementBase.InitiateTransition(TransitionSettings settings, Transition transition, UIElement element)
           at Infragistics.Win.UIElement.InitiateTransition(TransitionSettings settings, UIElementTransitionType transitionType)
           at Infragistics.Win.UltraWinToolbars.Ribbon.OnSelectedTabItemChanging(Object sender, SelectedTabItemChangingEventArgs e)
           at Infragistics.Win.UltraWinTabs.TabManager.set_SelectedTabItem(ITabItem value)
           at Infragistics.Win.UltraWinToolbars.Ribbon.InitializeTabManagerSelectedTab(ITabItem tabToSelect, Boolean ignoreSelectedTabEvents, Boolean allowMinimizeRibbonDropDown)
           at Infragistics.Win.UltraWinToolbars.Ribbon.InitializeTabManagerSelectedTab(ITabItem tabToSelect, Boolean ignoreSelectedTabEvents)
           at Infragistics.Win.UltraWinToolbars.Ribbon.SetSelectedTab(RibbonTab tab, Boolean expandRibbonIfCollapsed, Boolean forceSkipEvents)
           at Infragistics.Win.UltraWinToolbars.Ribbon.SetSelectedTab(RibbonTab tab, Boolean expandRibbonIfCollapsed)
           at Infragistics.Win.UltraWinToolbars.Ribbon.set_SelectedTab(RibbonTab value)
           at Infragistics.Win.UltraWinToolbars.Ribbon.BringIntoView(UIElement itemElement, RibbonLayoutItemBase layoutItem, RibbonGroup group, ToolBase tool)
           at Infragistics.Win.UltraWinToolbars.Ribbon.BringIntoView(RibbonGroup group, Boolean canThrowExceptions)
           at Infragistics.Win.UltraWinToolbars.Ribbon.BringIntoView(RibbonGroup group)
           at Infragistics.Win.UltraWinToolbars.RibbonGroup.BringIntoView()

     

     

    And this is at random times:

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

    Exception:

    System.ComponentModel.Win32Exception (0x80004005): The operation completed successfully

       at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation)

       at System.Drawing.Graphics.CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize)

       at Infragistics.Win.ControlUIElementBase.CaptureOldImage(UIElement element)

       at Infragistics.Win.TransitionInfo..ctor(UIElement element, Transition transition, TransitionSettings settings)

       at Infragistics.Win.ControlUIElementBase.InitiateTransition(TransitionSettings settings, Transition transition, UIElement element)

       at Infragistics.Win.UIElement.InitiateTransition(TransitionSettings settings, UIElementTransitionType transitionType)

       at Infragistics.Win.UltraWinToolbars.RibbonGroupUIElement.OnMouseEnter()

       at Infragistics.Win.ControlUIElementBase.ElementEntered(UIElement element, Boolean triggerMouseLeavesOnly)

       at Infragistics.Win.ControlUIElementBase.SyncMouseEntered(Boolean triggerMouseLeavesOnly, UIElementInputType inputType, Boolean ignoreLastElementEntered)

       at Infragistics.Win.ControlUIElementBase.ProcessMouseEnter(Object sender, EventArgs e)

       at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e)

       at Infragistics.Win.UltraControlBase.OnMouseEnter(EventArgs e)

       at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.OnMouseEnter(EventArgs e)

       at System.Windows.Forms.Control.WndProc(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

     

Children