Frame Grabber SDK (Windows-C) Developer Guide
}
// Open the device and get the device handle.
nRet = MV_FG_OpenDevice(hInterface, nSelectedDeviceIndex, &hDevice);
if (MV_FG_SUCCESS != nRet)
{
printf("Open device error, %#x\n", nRet);
hDevice = NULL;
break;
}
// Close the trigger mode.
nRet = MV_FG_SetEnumValueByString(hDevice, "TriggerMode", "Off");
if (MV_FG_SUCCESS != nRet)
{
printf("Turn off TriggerMode failed, %#x\n", nRet);
break;
}
// Get the number of streaming channels.
unsigned int nStreamNumber = 0;
nRet = MV_FG_GetNumStreams(hDevice, &nStreamNumber);
if (MV_FG_SUCCESS != nRet || 0 == nStreamNumber)
{
printf("No Stream available\n");
break;
}
// Open the streaming channel (now only a single streaming channel is supported)
nRet = MV_FG_OpenStream(hDevice, 0, &hStream);
if (MV_FG_SUCCESS != nRet)
{
printf("Open Stream error, %#x\n", nRet);
break;
}
// Get the image size.
unsigned int nImagePayloadSize = 0;
nRet = MV_FG_GetPayloadSize(hStream, &nImagePayloadSize);
if (MV_FG_SUCCESS != nRet)
{
printf("Get payload size error, %#x\n", nRet);
break;
}
// Allocate and register the buffer of images.
for (unsigned int i = 0; i < BUFFER_NUMBER; i++)
{
// Allocate the image buffer.
pBuffer[i] = malloc(nImagePayloadSize);
if (NULL == pBuffer[i])
136
    "