''没有重载匹配委托'system.eventhandler' [英] no overload for '' matches delegate 'system.eventhandler'

查看:428
本文介绍了''没有重载匹配委托'system.eventhandler'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好:)
我想创建一个对象数组!
我将mywinsocket.ocx添加到了我的项目中

检查一下!


Hello :)
i want to create an array of object !
i added my mywinsocket.ocx to my project

check this !


        AxProject1.AxSocket[] Socket = new AxProject1.AxSocket[5];
// load myclass 


        private void button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 5; i++)
            {
                AxProject1.AxSocket Winsock = new AxProject1.AxSocket();
                Winsock.DataArrival += new System.EventHandler(Socket_DataIncome);
                Winsock.ConnectEvent += new System.EventHandler(Connected);
                Socket[i] = Winsock;
                Socket[i].Name = "Socket" + i.ToString();
                Controls.Add(Socket[i]);
            }

        }

        private void Connected(object sender, EventArgs e)
        {

        }

        private void Socket_DataIncome(object sender,AxProject1.__Socket_DataArrivalEvent e)
        {

        }




我在Socket_DataIncome中遇到错误

''''没有重载匹配代表''system.eventhandler''

有人可以帮我吗

这是winsocket.ocx的链接
下载winsocket.ocx大小:11 kb [




i got an error in Socket_DataIncome

no overload for '''' matches delegate ''system.eventhandler''

can somebody help me

this is link of winsocket.ocx
Download winsocket.ocx size: 11 kb[^]

thanks

推荐答案

Your problem is in below method





private void Socket_DataIncome(object sender,AxProject1.__Socket_DataArrivalEvent e)
{

}


This error occured due to passing wrong arguments.


System.EventHandler contains below two arguments
1)Object sender
2)EventArgs e
Change your event procedure arguments
 private void Socket_DataIncome(object sender,EventArgs e)
        {
 
        }


仍然有错误!

应该是这样的
still have error !

it should be like this
object sender,AxProject1.__Socket_DataArrivalEvent e


这篇关于''没有重载匹配委托'system.eventhandler'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆