By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

cannot implicitly convert type MSCOMMLib System.EventHandler .NET

P: n/a
Hi,

Here I have a question about MSCommLib. I need to dynamically add
activeX controls that requires run-time license for MSCommLib. The
following is the actual code:

AxMSCommLib.AxMSComm mscomm = new AxMSCommLib.AxMSComm();

string strLicense = "gfjmrfkfifkmkfffrlmmgmhmnlulkmfmqkqj";

System.Reflection.FieldInfo f =
typeof(AxHost).GetField("licenseKey",
System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Instance);
f.SetValue(mscomm, strLicense);

mscomm.OnComm += new MSCommLib.DMSCommEvents_OnCommEventHandler
(this.mscomm_OnComm);

When I compile the above code, I get an error: "Cannot implicitly
convert type 'MSCommLib.DMSCommEvents_OnCommEventHandler' to
'System.EventHandler'".

Any advice about this problem is more than welcome.

Thanks,
Mindy
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.