请高手帮忙看看这个API的函数调用有什么问题!(解决和另外一贴一起结分!)
xuyo 2003-08-30 10:15:01 using System.Runtime.InteropServices;
[DllImport("CMPPAPI")]
public static extern int CMPPDeliver(int Ntimeout,out DeliverResp PDeliverResp);
[StructLayout(LayoutKind.Sequential)]
public struct DeliverResp
{
public string sMsgID;
public int nMsgLevel;
public string sServiceID;
public int nMsgFormat;
public string sSrcTermID;
public int nIsReply;
public int nMsgLen;
public string sMsgContent;
public string sDestTermID;
public char cTpPid;
public char cTpUdhi;
}
const int i=10;//等待时间10秒
DeliverResp theDeliverResp;
theDeliverResp=new DeliverResp();
CMPPDeliver(i,out theDeliverResp);
richTextBox1.Text=theDeliverResp.sMsgContent;\\显示短信内容
以上我是使用亚信提供的CMPP API中的DeliverResp();函数来接收短信,但是执行到
CMPPDeliver(i,out theDeliverResp);这句是就会报出:“未将对象引用设置到对象的实例。”请问问题可能出在什么地方?