How to use a class in an unmanged DLL
-
I have a video capturer card SDK. in the .h file, defined a class all functions is in the class. so i want to know how can i use the function? because when i use the [Dllimport] to define the function in C#, when running, it doesn't work right,for an exception means "can not found the entrypoint in dll". so i wondered the reason is the define of Class in dll file. what can i do then? the .h file is shown as below: // AVEControl.h: interface for the AVEControl class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_AVECONTROL_H__4E171B4B_A11B_49F1_B41C_5F4A31B5CF08__INCLUDED_) #define AFX_AVECONTROL_H__4E171B4B_A11B_49F1_B41C_5F4A31B5CF08__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifdef DEVICECONTROL_EXPORTS #define DEVICECONTROL_API __declspec(dllexport) #else #define DEVICECONTROL_API __declspec(dllimport) #endif typedef HRESULT (*AVECALLBACK) (PBYTE pbData, LONG lDataLength); #define E_DEVICE_NOT_READY 0xB0004001L class DEVICECONTROL_API AVEControl { public: HRESULT StartRecordWithoutPreview(HWND hWndCap, CString FileName, __int64 pFileLength, UINT pFileMessage, BOOL pShowSetting = TRUE); HRESULT StartRecordWithPreview(HWND hWndCap, RECT rc, CString FileName, __int64 pFileLength, UINT pFileMessage, BOOL pShowSetting = TRUE); HRESULT StartPreview(HWND hWndCap, RECT rc); HRESULT SetVideoClippingWindow(HWND hwnd); HRESULT SetCallback(AVECALLBACK Callback); HRESULT GetVideoStatus(PUCHAR pSta); HRESULT SetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect); void GetCurrentImage(CString BmpFileFullName); BOOL IsGraphRunning(void); HRESULT StopGraph(void); HRESULT ApplySettings(CString IniFileFullName); HRESULT SetVideoProcAmp(long Property, long Value); HRESULT GetVideoProcAmp(long Property, long* Value); HRESULT GetEvent(long* EventCode, LONG_PTR* Param1, LONG_PTR* Param2, long msTimeout); HRESULT SetNotifyWindow(OAHWND hwnd, long lMsg, LONG_PTR lInstanceData); HRESULT InitDeviceControl(void); AVEControl(); virtual ~AVEControl(); }; #endif // !defined(AFX_AVECONTROL_H__4E171B4B_A11B_49F1_B41C_5F4A31B5CF08__INCLUDED_)