Home > C: Programming > Function descriptions > History back  Previous chapter  Next chapter  Print  

is_InitEvent

uEye Camera Manual Version 4.00

is_InitEvent

Windows_Logo

Linux_Logo

USB 2.0

USB 3.0

GigE

-

Syntax

INT is_InitEvent (HIDS hCam, HANDLE hEv, INT which)

Description

is_InitEvent() initializes the event handle for the specified event object. This registers the event object in the uEye kernel driver.

Achtung

Note on using USB cameras under Windows

The following events require a Windows message loop. This message loop has to be executed by the thread that loads the uEye API. The message loop is usually provided by the application window. In some cases, the message loop might not be created automatically (e.g. in console applications). In this case you will need to implement the message loop yourself.

This applies to the following uEye events:

IS_SET_EVENT_REMOVE

IS_SET_EVENT_REMOVAL

IS_SET_EVENT_DEVICE_RECONNECTED

IS_SET_EVENT_NEW_DEVICE

If no message loop exists, a USB camera will not be automatically detected after reconnecting.

Input parameters

hCam

Camera handle

hEv

Event handle created by the CreateEvent() Windows API function.

which

ID of the event to be initialized (see is_EnableEvent())

Return values

IS_INVALID_CAMERA_HANDLE

Invalid camera handle

IS_INVALID_PARAMETER

One of the submitted parameters is outside the valid range or is not supported for this sensor or is not available in this mode.

IS_NO_SUCCESS

General error message

IS_SUCCESS

Function executed successfully

Related functions

is_EnableEvent()

is_DisableEvent()

is_ExitEvent()

Example

HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);

 

//Enable frame event, start image capture and wait for event

is_InitEvent(hCam, hEvent, IS_SET_EVENT_FRAME);

is_EnableEvent(hCam, IS_SET_EVENT_FRAME);

is_FreezeVideo(hCam, IS_DONT_WAIT);

DWORD dwRet = WaitForSingleObject(hEvent, 1000);

if (dwRet == WAIT_TIMEOUT)

{

  /* wait timed out */

}

else if (dwRet == WAIT_OBJECT_0)

{

  /* event signalled */

}

is_DisableEvent(hCam, IS_SET_EVENT_FRAME);

is_ExitEvent(hCam, IS_SET_EVENT_FRAME);

CloseHandle(hEvent);

Sample programs

SimpleLive (C++)

uEyeEvent (C++)


Suggestion for improvement? Send us your short Feedback on this chapter. Thank you very much!

For technical questions please contact you local distributor or use the support form on our website.


© 2012 IDS Imaging Development Systems GmbH
http://www.ids-imaging.com