日期:2014-05-18  浏览次数:20706 次

一个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);