首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

一个C的DLL,怎么声明注册到程序,有三个方法,两个已经写了,另一个不知道如何写,多谢

2012-04-07 
一个C的DLL,如何声明注册到程序,有三个方法,两个已经写了,另一个不知道怎么写,谢谢如:function GetDate: I

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

热点排行