Frame Grabber SDK (Windows-C) Developer Guide
// Display device information.
if (false == PrintDeviceInfo(hInterface, nDeviceNum))
{
break;
}
// Select the device.
int nDeviceIndex = -1;
printf("Select a device: ");
scanf_s("%d", &nDeviceIndex);
ClearStdin();
if (nDeviceIndex < 0 || nDeviceIndex >= (int)nDeviceNum)
{
printf("Invalid device index.\nQuit.\n");
break;
}
// Open the device and get the device handle.
nRet = MV_FG_OpenDevice(hInterface, (unsigned int)nDeviceIndex, &hDevice);
if (MV_FG_SUCCESS != nRet)
{
printf("Open No.%d device failed! %#x\n", nDeviceIndex, nRet);
hDevice = NULL;
break;
}
// Register the exception information callback function of the device.
//nRet = MV_FG_RegisterExceptionCallBack(hDevice, ExceptionCb, hDevice);
//if (MV_FG_SUCCESS != nRet)
//{
// printf("Register device exception callback failed!\n");
// break;
//}
// Disable trigger mode.
nRet = MV_FG_SetEnumValueByString(hDevice, "TriggerMode", "Off");
if (MV_FG_SUCCESS != nRet)
{
printf("Turn off trigger mode failed! %#x\n", nRet);
break;
}
// Get the number of stream channels.
unsigned int nStreamNum = 0;
nRet = MV_FG_GetNumStreams(hDevice, &nStreamNum);
if (MV_FG_SUCCESS != nRet || 0 == nStreamNum)
{
printf("No stream available! return = %d, number = %d\n", nRet, nStreamNum);
break;
}
105
    "