函数指针类型转换错误?
// ------------------------------// DYN.h// ------------------------------#include <Vfw.h>typedefHWND VFWAPI DYN_capCreateCaptureWindowA ( LPCSTR lpszWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hwndParent, int nID);typedefBOOL VFWAPI DYN_capGetDriverDescriptionA (UINT wDriverIndex, LPSTR lpszName, int cbName, LPSTR lpszVer, int cbVer);typedefHWND VFWAPI DYN_capCreateCaptureWindowW ( LPCWSTR lpszWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hwndParent, int nID);typedefBOOL VFWAPI DYN_capGetDriverDescriptionW (UINT wDriverIndex, LPWSTR lpszName, int cbName, LPWSTR lpszVer, int cbVer);#ifdef UNICODE#define pfncapCreateCaptureWindow pfncapCreateCaptureWindowW;#define pfncapGetDriverDescription pfncapGetDriverDescriptionW;#else#define pfncapCreateCaptureWindow pfncapCreateCaptureWindowA;#define pfncapGetDriverDescription pfncapGetDriverDescriptionA;#endifextern DYN_capCreateCaptureWindowA *pfncapCreateCaptureWindowA;extern DYN_capCreateCaptureWindowW *pfncapCreateCaptureWindowW;extern DYN_capGetDriverDescriptionA *pfncapGetDriverDescriptionA;extern DYN_capGetDriverDescriptionW *pfncapGetDriverDescriptionW;
/*************************webcam.h***************************/#include "DYN.h"/**************************************code*******************************************//**************************************code*******************************************//**************************************code*******************************************/bool CVideoCap::IsWebCam(){ if (m_bIsConnected) return false; bool bRet = false; char lpszName[100], lpszVer[50]; for (int i = 0; i < 10 && !bRet; i++) { bRet = pfncapGetDriverDescription(i, lpszName, sizeof(lpszName), /*此外正常*/ lpszVer, sizeof(lpszVer)); } return bRet;}/**************************************code*******************************************//**************************************code*******************************************//**************************************code*******************************************/CVideoCap::CVideoCap(){ // If FALSE, the system automatically resets the state to nonsignaled after a single waiting thread has been released. m_hCaptureEvent = CreateEvent(NULL, FALSE, FALSE, NULL); m_lpbmi = NULL; m_lpDIB = NULL; if (!IsWebCam() || m_bIsConnected) return; m_hWnd = CreateWindow("#32770", /* Dialog */ "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL); m_hWndCap = pfncapCreateCaptureWindow( /*出错代码行*/ "CVideoCap", WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, m_hWnd, 0 );}