Frame Grabber SDK (Windows-C) Developer Guide
// Select 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;
//}
// Enable chunk mode.
nRet = MV_FG_SetBoolValue(hDevice, "ChunkModeActive", true);
if (MV_FG_SUCCESS != nRet)
{
printf("Set chunk mode failed! %#x\n", nRet);
break;
}
// Set Chunk Selector to Exposure.
nRet = MV_FG_SetEnumValueByString(hDevice, "ChunkSelector", "Exposure");
if (MV_FG_SUCCESS != nRet)
{
printf("Set exposure chunk failed! %#x\n", nRet);
break;
}
// Enable chunk.
nRet = MV_FG_SetBoolValue(hDevice, "ChunkEnable", true);
if (MV_FG_SUCCESS != nRet)
{
printf("Set exposure chunk enable failed! %#x\n", nRet);
break;
114
    "