日期:2014-05-18 浏览次数:21005 次
//这个是组件类 public SmsClientClass sms = null; private void Form1_Load(object sender, EventArgs e) { this.btnLogin.Enabled = false; this.btnBalance.Enabled = false; sms = new SmsClientClass(); //这里不会报错 sms.OnConnect += new ISmsClientEvents_OnConnectEventHandler(onConnect); //这里就会出错(异常来自 HRESULT:0x80040202) //如果注释了上面的,这句就没错下句就会抱这个错,好像就能用一个事件 sms.OnLoginAccept += new ISmsClientEvents_OnLoginAcceptEventHandler(onLoginResp); sms.OnUserInfoAck += new ISmsClientEvents_OnUserInfoAckEventHandler(OnUserInfoAck); sms.OnSmsBatchAck += new ISmsClientEvents_OnSmsBatchAckEventHandler(onSendAck); }