Kald til dll
Jeg vil kalde nogle funktioner i en Win32 API-DLL fil, der har følgende metoder i headeren:public:
DLL_ACT DSRApi();
DLL_ACT ~DSRApi();
DLL_ACT bool SetResultCallBack(RESULTCALLBACK p);//call back to notify the result
DLL_ACT bool Start();
DLL_ACT bool Stop();
DLL_ACT bool AddCommand(const TCHAR* p_pcCommand);//command1 | command2 | ....
DLL_ACT bool Connect(const char* p_pcIp, unsigned int subport);
DLL_ACT bool CloseConnect();
DLL_ACT void Push(bool bIsSpStart);
Jeg har nu lavet metode kald fra C#, som følger ex:
[DllImport("DSRWinDll.dll")]
public static extern bool CloseConnect();
Men når jeg kalder ex. CloseConnect(), får jeg følgende fejl:
An unhandled exception of type 'System.MissingMethodException' occurred in Application3.exe
