Frame Grabber SDK (Windows-C) Developer Guide
{
break;
}
// 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.
DLL_OpenDevice DLLOpenDevice = (DLL_OpenDevice)GetProcAddress(MVFGCtrlDll,
"MV_FG_OpenDevice");
nRet = DLLOpenDevice(hInterface, (unsigned int)nDeviceIndex, &hDevice);
if (MV_FG_SUCCESS != nRet)
{
printf("Open No.%d device failed! %#x\n", nDeviceIndex, nRet);
hDevice = NULL;
break;
}
// Disable trigger mode.
DLL_SetEnumValueByString DLLSetEnumValueByString =
(DLL_SetEnumValueByString)GetProcAddress(MVFGCtrlDll, "MV_FG_SetEnumValueByString");
nRet = DLLSetEnumValueByString(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;
DLL_GetNumStreams DLLGetNumStreams =
(DLL_GetNumStreams)GetProcAddress(MVFGCtrlDll, "MV_FG_GetNumStreams");
nRet = DLLGetNumStreams(hDevice, &nStreamNum);
if (MV_FG_SUCCESS != nRet || 0 == nStreamNum)
{
printf("No stream available! return = %d, number = %d\n", nRet, nStreamNum);
break;
}
// Open stream channel (currently only one stream channel is supported at a time).
DLL_OpenStream DLLOpenStream = (DLL_OpenStream)GetProcAddress(MVFGCtrlDll,
"MV_FG_OpenStream");
127
    "