读书人

一个C的DLL怎么声明注册到程序有三

发布时间: 2012-04-07 17:31:50 作者: rapoo

一个C的DLL,如何声明注册到程序,有三个方法,两个已经写了,另一个不知道怎么写,谢谢
如:
function GetDate: Integer; stdcall; external 'WebAccess.dll';
function SetDate(SN: PWideChar): Integer; stdcall; external 'WebAccess.dll';
对应:
[System.Runtime.InteropServices.DllImport("WebAccess.dll", EntryPoint = "GetDate")]
public static extern int GetValidateDate();
[System.Runtime.InteropServices.DllImport("WebAccess.dll", EntryPoint = "SetDate", CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
public static extern int SetValidateDate(string ValidateCode);
那:
function GetInfo(SoftType: PByte; FuncFlags: PDWORD): Integer; stdcall;
这条怎么写?

谢谢

[解决办法]
帮你改了下,试试
[System.Runtime.InteropServices.DllImport("WebAccess.dll", EntryPoint = "GetInfo", CharSet = CharSet.Auto)]
public static extern int GetValidateInfo(ref byte softType, ref int funcFlags);

byte softType = 0;
int funcFlags = 0;
int infoResult = GetValidateInfo(ref softType, ref funcFlags);

读书人网 >C#

热点推荐