简体   繁体   English

WPF表单中的控件有限(win32exception与每个窗口10,000个控件冲突)

[英]Limited controls in WPF Form (win32exception conflicts with 10,000 controls per window)

I have a program running fine but when it hit nearly 10,000 images in WPF form thrown exception System.ComponentModel.Win32Exception: The operation completed successfully. 我有一个运行良好的程序,但是当它以WPF格式命中近10,000张图像时,引发了异常System.ComponentModel.Win32Exception:操作成功完成。

it so weird, sounds poor design, but functioning well as per the requirements. 它听起来很怪异,听起来设计不佳,但按要求运行良好。 Without splitting process in to multiple, is there any better way that helps in getting rid of this issue and allow users to process over 10,000 images (controls in form). 如果不将过程分成多个部分,那么还有什么更好的方法可以帮助解决此问题,并允许用户处理10,000多个图像(窗体控件)。

I have double checked unmanged code disposed properly and used using blocks etc.. 我仔细检查了未处理的代码,将其正确放置并使用块等。

Background : Application creates image thumbnails of PDF pages and the images are stored in cache. 背景:应用程序创建PDF页面的图像缩略图,并将图像存储在缓存中。 Application is working well in handling a big load in giga bytes though it takes fair bit of time to create images on screen .(this is an acceptable delay) 尽管在屏幕上创建图像需要花费大量时间,但应用程序在处理千兆字节的大负载方面运行良好(这是可以接受的延迟)

It sounds like you have reached the Windows limit of 10,000 user handles . 听起来您已经达到10,000个用户句柄Windows限制

You might want to try batching up the processing, or maybe using a virtualizing panel like the VirtualizingStackPanel to display the images. 您可能想要尝试分批处理,或者使用虚拟化面板(例如VirtualizingStackPanel)显示图像。 This will only create UI controls as they are scrolled into view. 这只会在滚动到视图中时创建UI控件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM