Hi,
Ensure the mscomm.OnComm event indeed has the
MSCommLib.DMSCommEvents_OnCommEventHandler type and that the
this.mscomm_OnComm method has the signature matching the event delegate's
one.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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