WaitForMultipleObjects

WaitForMultipleObjects

本文介绍了WaitForMultipleObjects未捕获事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个程序。两者都打开一个命名事件,说"START_EVENT"。 Process1使用
SetEvent 调用触发事件。 Process2使用 WaitForMultipleObjects 调用来捕获偶数。使用
WaitForMultipleObjects 调用,因为还有其他要捕获的事件。但由于某种原因,Process2没有捕获START_EVENT!


使用此调用CreateEvent(NULL,FALSE,FALSE," START_EVENT")创建事件。


Process2使用WaitForMultipleObjects(4,Events,FALSE,INFINITE)调用捕获事件。这里的Events是一个HANDLE数组。


当事件被触发时,WaitForMultipleObjects调用只是等待而不会失败。有人请告诉我WaitForMultipleObjects调用不能捕获事件的原因。


提前致谢。




Natarajan RJ

解决方案

I have two processes. Both open a named event say "START_EVENT". Process1 triggers the event usingSetEvent call. Process2 uses WaitForMultipleObjects call to capture the even.WaitForMultipleObjects call is used because there are other events to capture. But for some reason Process2 doesn't capture the START_EVENT!

The events are created using this call, CreateEvent(NULL, FALSE, FALSE, "START_EVENT").

Process2 uses WaitForMultipleObjects(4, Events, FALSE, INFINITE) call to capture the event. Here Events is an array of HANDLE.

When the event is triggered, the WaitForMultipleObjects call just wait and doesn't fail. Somebody please tell what might be the reason for WaitForMultipleObjects call not to capture the event.

Thanks in advance.


Natarajan RJ

解决方案


这篇关于WaitForMultipleObjects未捕获事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-19 01:42