Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

C# deleate event - how do you say it in VBA ?

$
0
0

Hi

My Test class attach handler as CommPort.MyEvent += MyHandler;     (C#)

CommPort is the class being tested. It generates events.

How should i code the said statement  in VBA using AddressOf ?

CommPort class header

   [ClassInterface(ClassInterfaceType.AutoDual)]
    public class CommPort : PortParamIf
    {
        .....

        public delegate void MyDelegate(string s);
        public static event MyDelegate MyEvent;

        .....

       public static void OnMyEvent()
        {
            if (MyEvent != null && RxData.Length > 1 )
            {
                 MyEvent(RxData); 
            }
        }

Seems that MyEvent is not exposed to VBA, how do i rectify it ?

Thanks



Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>