none
handle Activex event in javascript

    Question

  • i use c# make activex control ,and insert in iE.

    The code is:

    [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
            [ComVisible(true)]
            [Guid("B9DF0B51-3155-445E-B5A9-46A2975AF066")]
            public interface INF
            {
                [DispId(0x00000001)]
                bool OnButtonDblClk( int nflags, int wx, int wy);
        }

    and the C# event ,delegate is :

    public delegate bool ButtonDown( int flags, int wx, int wy);
    public event ButtonDown OnButtonDblClk;

    then in javascript:

    <script for="myComComponent" event="OnButtonDblClk(arg1,arg2,arg3)" language="javascript">
        ...
    </script>

    if there is function OnButtonDblClk in javascript , activex could invoke the function.But when there is no function in javascript would result error in activex even i check the OnButtonDblClk event before invoke the function.The check event is that the event is not null.so is there any way to avoid invoke the function when there is no function in javascript??

    Thanks!!

    Friday, November 06, 2015 11:10 AM

Answers