Example #1
0
                private void OnLink(Ddeml.MONLINKSTRUCT mon)
                    {
                        StringBuilder psz;
                        int length;

                        // Get the service name from the hszSvc string handle.
                        psz = new StringBuilder(Ddeml.MAX_STRING_SIZE);
                        length = Ddeml.DdeQueryString(_Context.InstanceId, mon.hszSvc, psz, psz.Capacity,
                            Ddeml.CP_WINANSI);
                        string service = psz.ToString();

                        // Get the topic name from the hszTopic string handle.
                        psz = new StringBuilder(Ddeml.MAX_STRING_SIZE);
                        length = Ddeml.DdeQueryString(_Context.InstanceId, mon.hszTopic, psz, psz.Capacity,
                            Ddeml.CP_WINANSI);
                        string topic = psz.ToString();

                        // Get the item name from the hszItem string handle.
                        psz = new StringBuilder(Ddeml.MAX_STRING_SIZE);
                        length = Ddeml.DdeQueryString(_Context.InstanceId, mon.hszItem, psz, psz.Capacity,
                            Ddeml.CP_WINANSI);
                        string item = psz.ToString();

                        var args = new DdemlLinkActivityEventArgs(
                            service,
                            topic,
                            item,
                            mon.wFmt,
                            !mon.fNoData,
                            mon.fEstablished,
                            mon.fServer,
                            mon.hConvClient,
                            mon.hConvServer,
                            mon.hTask);

                        if (LinkActivity != null)
                            LinkActivity(this, args);
                    }
Example #2
0
        private void OnLink(Ddeml.MONLINKSTRUCT mon)
        {
            StringBuilder psz;
            int length;

            // Get the service name from the hszSvc string handle.
            psz = new StringBuilder(Ddeml.MAX_STRING_SIZE);
            length = Ddeml.DdeQueryString(_Context.InstanceId, mon.hszSvc, psz, psz.Capacity, Ddeml.CP_WINANSI);
            string service = psz.ToString();

            // Get the topic name from the hszTopic string handle.
            psz = new StringBuilder(Ddeml.MAX_STRING_SIZE);
            length = Ddeml.DdeQueryString(_Context.InstanceId, mon.hszTopic, psz, psz.Capacity, Ddeml.CP_WINANSI);
            string topic = psz.ToString();

            // Get the item name from the hszItem string handle.
            psz = new StringBuilder(Ddeml.MAX_STRING_SIZE);
            length = Ddeml.DdeQueryString(_Context.InstanceId, mon.hszItem, psz, psz.Capacity, Ddeml.CP_WINANSI);
            string item = psz.ToString();

            DdemlLinkActivityEventArgs args = new DdemlLinkActivityEventArgs(
                service,
                topic,
                item,
                mon.wFmt,
                !mon.fNoData,
                mon.fEstablished,
                mon.fServer,
                mon.hConvClient,
                mon.hConvServer,
                mon.hTask);

            if (LinkActivity != null)
            {
                LinkActivity(this, args);
            }
        }
 internal DdeLinkActivityEventArgs(DdemlLinkActivityEventArgs args)
     : base(args)
 {
     _DdemlObject = args;
 }