Frame Grabber SDK (Windows-C) Developer Guide
if (MV_FG_SUCCESS != nRet)
{
printf("Close device failed! %#x\n", nRet);
}
hDevice = NULL;
}
// Close the frame grabber.
if (NULL != hInterface)
{
nRet = MV_FG_CloseInterface(hInterface);
if (MV_FG_SUCCESS != nRet)
{
printf("Close interface failed! %#x\n", nRet);
}
hInterface = NULL;
}
printf("Press any key to exit.\n");
WaitForKeyPress();
return 0;
}
A.6 Load Dynamic Link Library
The following sample codes show how to use the frame grabber SDK with dynamic calling.
#include <stdio.h>
#include <Windows.h>
#include <process.h>
#include <conio.h>
#include "MVFGDefines.h"
#include "MVFGErrorDefine.h"
typedef unsigned char* (__stdcall * DLL_GetSDKVersion)
();
typedef int
(__stdcall * DLL_UpdateInterfaceList) (IN unsigned int nTLayerType, OUT
bool8_t *pbChanged);
typedef int
(__stdcall * DLL_GetNumInterfaces)
(OUT unsigned int *pnNumIfaces);
typedef int
(__stdcall * DLL_GetInterfaceInfo)
(IN unsigned int nIndex, OUT
MV_FG_INTERFACE_INFO *pstIfaceInfo);
typedef bool
(__stdcall * DLL_GetInterfaceInfoEx) (IN unsigned int nIndex, IN
MV_FG_INTERFACE_INFO_CMD enIfaceInfoCmd, OUT MV_FG_INFO_VALUE *pstInfoValue);
typedef int
(__stdcall * DLL_OpenInterface)
(IN unsigned int nIndex, OUT
IFHANDLE* phIface);
typedef int
(__stdcall * DLL_OpenInterfaceEx)
(IN unsigned int nIndex, IN int
nAccess, OUT IFHANDLE* phIface);
typedef int
(__stdcall * DLL_CloseInterface)
(IN IFHANDLE hIface);
typedef int
(__stdcall * DLL_UpdateDeviceList)
(IN IFHANDLE hIface, OUT bool8_t
*pbChanged);
117
    "