winsock2.pas 에 보면 WSAEVENT 는 THANDLE type 이더군요. 그런데 THANDLE 형을 잘 모르겠습니다. help 에서도 THandleObject나 THandleStream 객체에대해서는 찾아볼 수 있지만 THandle 은 뭔지 모르겠어요.
그리고 위와 관계되어...
EventMsg = WSAEVENT;
라고 선언한 후에 뒤에서
EventMsg := CreateEvent(NIL, FALSE, FALSE, NIL);
하는 것을 보았는데, CreateEvent 라는 function역시 무엇인지 알 수가 없군요.
function WSACreateEvent: WSAEVENT
를 찾아보았지만 아규먼트가 사용되지 않더군요. 그러니 메크로 함수는 아닐테
고.. CreateEvent 함수는 무엇이죠?
> winsock2.pas 에 보면 WSAEVENT 는 THANDLE type 이더군요. 그런데 THANDLE 형을 잘 모르겠습니다. help 에서도 THandleObject나 THandleStream 객체에대해서는 찾아볼 수 있지만 THandle 은 뭔지 모르겠어요.
Lyle 님 안녕하세요? 참조하세요
=========================================================================
Handle is the handle of the Windows object used by THandleObject.
type THandle = Integer;
property Handle: THandle;
Description
Read Handle to obtain the Windows handle for the synchronization object. Use Handle when making Windows API calls that require a handle to the synchronization object.
THandleObject provides no mechanism for setting the Handle property. Descendants of THandleObject set the Handle property to the handle for whatever Windows synchronization object they represent.
=========================================================================
>
> 그리고 위와 관계되어...
>
> EventMsg = WSAEVENT;
>
> 라고 선언한 후에 뒤에서
>
> EventMsg := CreateEvent(NIL, FALSE, FALSE, NIL);
> 하는 것을 보았는데, CreateEvent 라는 function역시 무엇인지 알 수가 없군요.
>
> function WSACreateEvent: WSAEVENT
>
> 를 찾아보았지만 아규먼트가 사용되지 않더군요. 그러니 메크로 함수는 아닐테
> 고.. CreateEvent 함수는 무엇이죠?
>
The CreateEvent function creates a named or unnamed event object.
HANDLE CreateEvent(
LPSECURITY_ATTRIBUTES lpEventAttributes, // address of security attributes
BOOL bManualReset, // flag for manual-reset event
BOOL bInitialState, // flag for initial state
LPCTSTR lpName // address of event-object name
);
Parameters
lpEventAttributes
Points to a SECURITY_ATTRIBUTES structure that specifies the security attributes for the event object.
If lpEventAttributes is NULL, the event object is created with a default security descriptor and the resulting handle is not inheritable.
bManualReset
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, Windows automatically resets the state to nonsignaled after a single waiting thread has been released.
bInitialState
Specifies the initial state of the event object. If TRUE, the initial state is signaled; otherwise, it is nonsignaled.
lpName
Points to a null-terminated string specifying 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, this function requests EVENT_ALL_ACCESS access to the existing object. In this case, the bManualReset and bInitialState parameters are ignored because they have already been set by the creating process. If the lpEventAttributes parameter is not NULL, it determines whether the handle can be inherited, but its security-descriptor member is ignored.
If lpName is NULL, the event object is created without a name.
If lpName matches the name of an existing semaphore, mutex, or file-mapping object, the function fails and the GetLastError function returns ERROR_INVALID_HANDLE. This occurs because event, mutex, semaphore, and file-mapping objects share the same name space.
Return Value
If the function succeeds, the return value is a handle of the event object. If the named event object existed before the function call, the GetLastError function returns ERROR_ALREADY_EXISTS. Otherwise, GetLastError returns zero.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.