原创 CreateEvent()函数翻译

2009-9-18 09:43 3443 11 11 分类: MCU/ 嵌入式

This function creates a named or an unnamed event object.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


这个函数创建一个命名或未命名的事件对象。


<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /> Syntax


语法


HANDLE CreateEvent(


  LPSECURITY_ATTRIBUTES


  lpEventAttributes,


  BOOL bManualReset,


  BOOL InitialState,


  LPTSTR lpName


);


 Parameters


参数


lpEventAttributes


[in] Ignored. Must be NULL.


【输入】被忽略的,必须是NULL


bManualReset


[in] Boolean that specifies whether a manual-reset or auto-reset event object is created. If TRUE, then you must use the ResetEvent function to manually reset the state to nonsignaled. If FALSE, the system automatically resets the state to nonsignaled after a single waiting thread has been released.


【输入】布尔量,指明被创建事件对象为手动重置还是自动重置。如果为ture则,你必须使用ResetEvent函数手动重置状态为不可触发状态。如果为FALSE,系统在等待线程被释放后自动重置状态为不可触发状态。


bInitialState


[in] Boolean that specifies the initial state of the event object. If TRUE, the initial state is signaled; otherwise, it is nonsignaled.


【输入】布尔量,指定事件对象的初始状态。如果True,初始状态为可触发,否则为,不可触发状态。


lpName


[in] Pointer to a null-terminated string that specifies the name of the event object. The name is limited to MAX_PATH characters and can contain any character except the backslash path-separator character (\). Name comparison is case sensitive.


If lpName matches the name of an existing named event object, the bManualReset and bInitialState parameters are ignored because they have already been set by the creation process.


【输入】指向一个null结束的字符串指定事件的名称。名称被限定在MAX_PATH字符,可以包括除反斜杠字符以外的其他任何字符。名称区分大小写。如果lpName和一个已存在的事件相符,则bManualReset bInitialState参数将被忽略,因为它已经被指定在创建过程中。


If lpName is NULL, the event object is created without a name.


如果lpNameNULL,则被创建事件对象没有名称。


 Return Value


 For Windows Embedded CE


A handle to the event object indicates success. If a named event object existed before you call this function, CreateEvent returns a new handle to the same object, and GetLastError returns ERROR_ALREADY_EXISTS. Both handles must be closed. The two handles refer to the same event, so calling SetEvent on one of the events is equivalent to calling SetEvent on the other. The handle value is different. This behavior is the same as the behavior on a Windows-based desktop platform.


返回值


Windows ce嵌入操作系统


成功返回一个事件对象句柄。被指定对象如果已经存在,则调用CreateEvent返回一个新的句柄指向相同的对象,GetLastError返回ERROR_ALREADY_EXISTS。两个句柄必须被关闭。两个句柄指向同一个事件,在一个事件中调用SetEvent和在另一个事件中调用相同。句柄值不相同,这种特性同windows桌面平台相同。


 


 Requirements



Header


winbase.h


Library


coredll.lib, Nk.lib


Windows Embedded CE


Windows CE 1.0 and later


Windows Mobile


Windows Mobile Version 5.0 and later


 

文章评论0条评论)

登录后参与讨论
我要评论
0
11
关闭 站长推荐上一条 /2 下一条