Hi Guys,
I have a C++ third party dll which does some algorithms for us and seldomly passes data back. Now we were wanting to use DLLIMPORT from c# to utilize these functions from C++ but are having some issues.
Here are the function declaration in C++.
To utilize the above i have written the following c# code.
Please advise what am i doing wrong here as each time i try to invoke DoWSUpdate i get
Please help guys.......
I have a C++ third party dll which does some algorithms for us and seldomly passes data back. Now we were wanting to use DLLIMPORT from c# to utilize these functions from C++ but are having some issues.
Here are the function declaration in C++.
Code:
int DoWSUpdate(LPSTR lpName,LPSTR lpPath,LPSTR lpBinPath,MyCallBack pMyCallBack) void (CALLBACK *MyCallBack)(DWORD dStatus,LPSTR Cur,long Complete,long AllComplete,LPSTR szDescript)
Code:
public delegate void MyCallBack(int dStatus, string Cur, long Complete, long AllComplete, string szDescript);
[DllImport("CPLUS.dll", SetLastError = true, EntryPoint = "DoWSUpdate")]
public static extern int DoWSUpdate([MarshalAs(UnmanagedType.LPStr)] string lpName, [MarshalAs(UnmanagedType.LPStr)] string lpPath, [MarshalAs(UnmanagedType.LPStr)] string lpBinPath, [MarshalAs(UnmanagedType.FunctionPtr)] MyCallBack pMyCallBack);
Unable to find an entry point named 'DoWSUpdate' in DLL 'CPLUS.dll'.
Please help guys.......