当前位置: 代码迷 >> ASP.NET >> 贴代码 求解.解决方法
  详细解决方案

贴代码 求解.解决方法

热度:9572   发布时间:2013-02-25 00:00:00.0
贴代码 求解..
[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
  相关解决方案