C API 声明如下所示
include <nsfdb.h>
STATUS LNPUBLIC NSFDbOpen(
const char far *PathName,
DBHANDLE far *rethDB
);
https://opensource.hcltechsw.com/domino-c-api-docs/reference/Func/NSFDbOpen/
[DllImport("nnotes.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int NSFDbOpen(string path, ref IntPtr pHandleDb);
我尝试过 Cdecl 和 stdcall。我尝试过 ref / out IntPtr 和 int
当我调用该函数时
int result = NSFDbOpen(dbPath, ref dbHandle);
我收到此错误
我可以补充一点,我在 Visual basic 6 中使用过这个,然后手柄很长
char*
是单字节,不是 Unicode。
[DllImport("nnotes.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern int NSFDbOpen(string path, ref IntPtr pHandleDb);