Frame Grabber SDK (Windows-C) Developer Guide
// Close the device.
if (NULL != hDevice)
{
DLL_CloseDevice DLLCloseDevice = (DLL_CloseDevice)GetProcAddress(MVFGCtrlDll,
"MV_FG_CloseDevice");
nRet = DLLCloseDevice(hDevice);
if (MV_FG_SUCCESS != nRet)
{
printf("Close device failed! %#x\n", nRet);
}
hDevice = NULL;
}
// Close the frame grabber.
if (NULL != hInterface)
{
DLL_CloseInterface DLLCloseInterface = (DLL_CloseInterface)GetProcAddress(MVFGCtrlDll,
"MV_FG_CloseInterface");
nRet = DLLCloseInterface(hInterface);
if (MV_FG_SUCCESS != nRet)
{
printf("Close interface failed! %#x\n", nRet);
}
hInterface = NULL;
}
FreeLibrary(MVFGCtrlDll);
printf("Press any key to exit.\n");
WaitForKeyPress();
return 0;
}
A.7 Receive Events
The following sample codes show how to configure the frame grabber event, how to register event
callback, and how to handle the event information received in the callback function.
#include <Windows.h>
#include <conio.h>
#include <stdio.h>
#include <process.h>
#include "MVFGControl.h"
bool g_bExit = FALSE;
#define BUFFER_NUMBER
3
// Number of requested buffers
void __stdcall EventCallBack(MV_FG_EVENT_INFO* pstEventInfo, void* pUser)
129
    "