
Frame Grabber SDK (Windows-C) Developer Guide
break;
}
// Enable stream channel (currently only one stream channel is supported at a time).
nRet = MV_FG_OpenStream(hDevice, 0, &hStream);
if (MV_FG_SUCCESS != nRet)
{
printf("Open stream failed! %#x\n", nRet);
break;
}
// Register the exception information callback function of the stream channel.
//nRet = MV_FG_RegisterExceptionCallBack(hStream, ExceptionCb, hStream);
//if (MV_FG_SUCCESS != nRet)
//{
// printf("Register stream exception callback failed!\n");
// break;
//}
// Set the number of internal buffers for the SDK.
nRet = MV_FG_SetBufferNum(hStream, BUFFER_NUMBER);
if (MV_FG_SUCCESS != nRet)
{
printf("Set buffer number failed! %#x\n", nRet);
break;
}
Callback_User stUerParam;
memset(&stUerParam, 0, sizeof(Callback_User));
stUerParam.hDevice = hDevice;
// Register the frame buffer information callback function.
nRet = MV_FG_RegisterFrameCallBack(hStream, FrameCb, &stUerParam);
if (MV_FG_SUCCESS != nRet)
{
printf("Register frame callback failed! %#x\n", nRet);
break;
}
// Start image acquisition.
nRet = MV_FG_StartAcquisition(hStream);
if (MV_FG_SUCCESS != nRet)
{
printf("Start acquistion failed! %#x\n", nRet);
return nRet;
}
printf("Press any key to stop acquisition.\n");
WaitForKeyPress();
// Stop image acquisition.
73





















































































































































