PostMessage()错误 [英] PostMessage() error

查看:746
本文介绍了PostMessage()错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



PostMessage()函数在

循环中运行700次后返回ERROR_NOT_ENOUGH_QUOTA,但磁盘空间和内存仍然足够大。


有什么建议可以解决这个问题吗?

谢谢。

解决方案

> PostMessage()函数返回ERROR_NOT_ENOUGH_QUOTA后,在


>循环中运行700次,但磁盘空间和内存仍然足够大。



这听起来像是一个安全限制,以防止过多的

消息。在正常情况下,它似乎表明

你试图将消息发布到一个不处理

消息的窗口。


>任何解决此问题的建议?



不要这样做。

允许其他应用程序运行并处理其消息。


Dave





4déc,08:56,one2001 ... @ yahoo.com ; < one2001 ... @ yahoo.comwrote:


PostMessage()函数在

循环中运行700次后返回ERROR_NOT_ENOUGH_QUOTA,但磁盘空间和内存仍然足够大。


任何解决此问题的建议?

谢谢。



为什么要尝试此测量?你想做什么?

Windows GUI消息的目标是GUI /窗口交互。通常,

达到这些限制意味着你正在颠覆GUI消息传递系统

来做别的事情,这不是为它设计的。

例如,我已经看过使用PostMessage的采集循环等。不要

这样做!


Arnaud

MVP - VC


David Lowndes写道:


>> PostMessage()函数在运行后返回ERROR_NOT_ENOUGH_QUOTA循环700次,但磁盘空间和内存仍然足够大。




这听起来像是一个安全限制,以防止过多的

消息。在正常情况下,它似乎表明

你试图将消息发布到一个没有处理

消息的窗口。



这里是示例代码。我删除了createprocess()函数。


>



int main()

{

....

while (fgets(psBuffer,BUFFER_SIZE,stdin)!= NULL){

PostString(hwndText,psBuffer);

}

.... }

void

PostString(HWND hwnd,char * pc)

{

while(* pc){

PostMessage(hwnd,WM_CHAR,(unsigned char)* pc,1L);

pc ++;

}

}


在处理了4k stdin管道数据之后,得到了ERROR_NOT_ENOUGH_QUOTA用于函数的问题
PostMessage()我有14K的

stdin数据处理)


你认为14k的stdio管道数据对于PostMessage()太大了吗?


谢谢。



PostMessage() function returns ERROR_NOT_ENOUGH_QUOTA after running in a
loop for 700 times, but the disk space and memory are still big enough.

any suggestion to resolve this problem?
thanks.

解决方案

>PostMessage() function returns ERROR_NOT_ENOUGH_QUOTA after running in a

>loop for 700 times, but the disk space and memory are still big enough.

That sounds like a safety limit to prevent excessive numbers of
messages. In normal circumstances it would seem to indicate that
you''re trying to post messages to a window that''s not processing
messages.

>any suggestion to resolve this problem?

Don''t do it.
Allow the other application to run and process its messages.

Dave




On 4 déc, 08:56, "one2001...@yahoo.com" <one2001...@yahoo.comwrote:

PostMessage() function returns ERROR_NOT_ENOUGH_QUOTA after running in a
loop for 700 times, but the disk space and memory are still big enough.

any suggestion to resolve this problem?
thanks.

Why are you trying this measurement? What are you trying to do?
Windows GUI messages are aimed at GUI/window interacting. Usually,
hitting those limits means you are subverting the GUI messaging system
to do something else, something it wasn''t designed for.

Eg, I have seen acquistion loops or the like using PostMessage. Don''t
do it!

Arnaud
MVP - VC


David Lowndes wrote:

>>PostMessage() function returns ERROR_NOT_ENOUGH_QUOTA after running in a
loop for 700 times, but the disk space and memory are still big enough.



That sounds like a safety limit to prevent excessive numbers of
messages. In normal circumstances it would seem to indicate that
you''re trying to post messages to a window that''s not processing
messages.

here is the sample code. I removed createprocess() function.

>

int main()
{
....
while (fgets(psBuffer, BUFFER_SIZE, stdin) != NULL) {
PostString(hwndText, psBuffer);
}
....}
void
PostString(HWND hwnd, char *pc)
{
while(*pc) {
PostMessage(hwnd, WM_CHAR, (unsigned char) *pc, 1L);
pc++;
}
}

it get the problem of ERROR_NOT_ENOUGH_QUOTA for the function of
PostMessage() after processing 4k of stdin piped data ( I have 14K of
stdin data to process)

do you think 14k of stdio piped data is too big for PostMessage()?

thanks.


这篇关于PostMessage()错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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