110,533
社区成员
发帖
与我相关
我的任务
分享
public struct tagPlayerInfo
{
public int id;
public string PlayerName;
public int Country;
public int OfficerRace;
public int Level;
public int MilitaryRank;
public int Money;
public int ResourceCount;
public int CityCount;
public int GeneralCount;
public int Credit;
};
[DllImport("um_web_client.dll")]
public static extern int GetPlayerList(int maxrows, ref int rows, [MarshalAs(UnmanagedType.LPStruct)]tagPlayerInfo ppPlayerInfo);
//使用
public void SomeMethod()
{
int maxrows = 10, rows = 0;
tagPlayerInfo ppPlayerInfo=new tagPlayerInfo();
GetPlayerList(maxrows, ref rows, ppPlayerInfo);
//ppPlayerInfo.id
}
public struct tagPlayerInfo
{
public int id;
public string PlayerName;
public int Country;
public int OfficerRace;
public int Level;
public int MilitaryRank;
public int Money;
public int ResourceCount;
public int CityCount;
public int GeneralCount;
public int Credit;
};
[DllImport("um_web_client.dll")]
public static extern int GetPlayerList(int maxrows, ref int rows, out tagPlayerInfo[] ppPlayerInfo);
//使用
public void SomeMethod()
{
int maxrows=10, rows = 0;
tagPlayerInfo[] ppPlayerInfo;
GetPlayerList(maxrows, ref rows, out ppPlayerInfo);
}
public struct tagPlayerInfo
{
public int id;
public string PlayerName;
public int Country;
public int OfficerRace;
public int Level;
public int MilitaryRank;
public int Money;
public int ResourceCount;
public int CityCount;
public int GeneralCount;
public int Credit;
};
[DllImport("um_web_client.dll")]
public static extern int GetPlayerList(int maxrows, ref int rows,out tagPlayerInfo[] ppPlayerInfo);