C + + function definition
extern " C " void Thundbirdphaselocalfolder (conststring* localfolderpaths,conststring BOOL (*isprocess) ()) { constchar* Localfolderpath = localfolderpaths- >c_str (); Const Char* zipfolder = zipfolders->c_str (); }
C # function definitions
namespacetestthunderbirdzippercsharp{classCppdll {[Unmanagedfunctionpointer (CALLINGCONVENTION.CDECL)] Public Delegate BOOLisprocess (); [DllImport ("ThunderbirdLocalFolderZipper.dll")] Public Static extern voidThundbirdphaselocalfolder ([MarshalAs (UNMANAGEDTYPE.LPWSTR)]stringLocalfolderpath, [MarshalAs (UNMANAGEDTYPE.LPWSTR)]stringZipfolder, [MarshalAs (unmanagedtype.functionptr)] isprocess isprocess); }}
C # calls
namespacetestthunderbirdzippercsharp{classProgram {Static BOOLFlag =true; Static BOOLcallback () {returnFlag; } Static voidMain (string[] args) { stringLocalfolderpath =""; stringZipfolder =""; Cppdll. Thundbirdphaselocalfolder (Localfolderpath, Zipfolder, callback); } }}
C # calls to C + + library (DLL) functions