读书人

贴代码 求解.解决方法

发布时间: 2012-03-28 15:40:03 作者: rapoo

贴代码 求解..
[DllImportAttribute("F://YHBus.dll", EntryPoint = "GetData", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
public static extern bool GetData(IntPtr pCommand, DMSTATUS DMStatus, int nSize);
public struct DMSTATUS//机状态
{
public int nYear;
public int nMonth;
public int nDay;
public int nWeek;
public int nHour;
public int nMinute;
public int nSecond;
public int nRecordCount;

}
bool tGetData = GetData(m_ActReturn,DMStatus, length);//这里始终返回false DMStatus空值 接受的数据包是正确的.. 求解

Console.WriteLine("年:" + DMStatus.nYear.ToString());


[解决办法]
原型是什么,是否该为 ref DMSTATUS DMStatus

读书人网 >asp.net

热点推荐