Outlook 2003 VSTO AddIn - 内存或系统资源不足。关闭一些窗口,然后再试一次 [英] Outlook 2003 VSTO AddIn - Out of memory or system resources. Close some windows and try again

查看:341
本文介绍了Outlook 2003 VSTO AddIn - 内存或系统资源不足。关闭一些窗口,然后再试一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个用于Outlook 2003的VSTO AddIn,它将电子邮件中附加的pfd和tiff文件分开并附加新文件。必须在检查器窗口中打开电子邮件才能执行此操作。只有在邮件具有richt文本
格式的情况下才会出现错误。


所以我有一个包含两个文件的电子邮件(一个pdf,一个tiff)。每个文件有23页。 addIn拆分文件,以便每个文件的每个页面都在自己的文件中。附加45个新文件后,会出现以下错误/消息框:


"内存或系统资源不足。关闭一些窗口并再次尝试"


当我关闭此消息时,我可以将更多文件附加到此电子邮件中。

那么可能是导致此错误的原因这个背景?


感谢您的建议。










内存或系统资源不足。关闭一些窗口然后再试一次

解决方案

Hello Nick,


好像你没有在代码中释放底层COM对象。还要确保释放文件句柄(或任何可以消耗内存的系统对象)。


使用 System.Runtime.InteropServices.Marshal.ReleaseComObject 以在完成使用后释放Outlook对象。然后
在Visual Basic中将变量设置为 Nothing (在C#中 null )以释放对该对象的引用。您可以在 中阅读更多相关信息。

系统释放对象 文章。


I have an VSTO AddIn for Outlook 2003 which splitts attached pfd and tiff files in a email and attaches the new files. The email must be open in an inspector window to perform this action. The error only occurs in the case that the mail has the richt text format.

So I have an email with two files (one pdf, one tiff). Every file has 23 pages. The addIn splits the files so that every page of every file is in its own file. After attaching of 45 of the new files the following error/message box occurs:

"Out of memory or system resources. Close some windows and try again"

When I close this message I can attach further files to this email.
So what could be the cause for this error in this context?

Thanks for the suggestions.

Out of memory or system resources. Close some windows and try again

解决方案

Hello Nick,

It seems you don't release underlying COM objects in the code. Also make sure that you release file handles (or any system objects that can consume memory).

Use System.Runtime.InteropServices.Marshal.ReleaseComObject to release an Outlook object when you have finished using it. Then set a variable to Nothing in Visual Basic (null in C#) to release the reference to the object. You can read more about this in the  Systematically Releasing Objects article.


这篇关于Outlook 2003 VSTO AddIn - 内存或系统资源不足。关闭一些窗口,然后再试一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆