title: Subscribe to OPC server data_changed event from windows service
body: <p>I want to read the item value from opc server by subscribing to OpcGroup_DataChanged event. I am able to do it through a windows form client. But when I am trying to do the same from windows service, the event is not firing. Can some body throw some light?
  Below is my implementation:</p>
  
  <pre><code>    OPCItemResult[] rslt;
          rtc = OpcGrp.AddItems(iDefs, out rslt);
          if (HRESULTS.Failed(rtc))
              return rtc;
  
          ItemHandles = new int[rslt.Length];
          errors = new int[iDefs.Length];
          for (int i = 0; i &lt; iDefs.Length; ++i)
          {
              ItemHandles[i] = rslt[i].HandleServer;
              errors[i] = rslt[i].Error;
          }
  
  
          // data changed callback handler
          OpcGrp.DataChanged += new DataChangeEventHandler(OpcGrp_DataChanged);
          OpcGrp.AdviseIOPCDataCallback();
          this.EventLog.WriteEntry("No of items: "+rtc.ToString(), EventLogEntryType.Information);
  </code></pre>
  
  <p>The Event:</p>
  
  <pre><code>    protected void OpcGrp_DataChanged(object sender, DataChangeEventArgs e)
      {
          this.EventLog.WriteEntry("Data changed at server", EventLogEntryType.Information);
  
          string txt = "";
          foreach (OPCItemState rslt in e.sts)
          {
              txt += rslt.DataValue.ToString() + "\r\n";
          }
          this.EventLog.WriteEntry(txt, EventLogEntryType.Information);
      }
  </code></pre>