My RegisterEventCB function is never invoked. Does anybody see what I messed up here? I know the connection is good because I can turn devices on and off.
My program is c# .net and is a class library. I am not sure if this does not work will class libraries.
My program is c# .net and is a class library. I am not sure if this does not work will class libraries.
Code:
public void RegisterCallback(ref object frm) { /* * Call back into HS and get a reference to the HomeSeer ActiveX interface * this can be used make calls back into HS like hs.SetDeviceStatus, etc. * The callback object is a different interface reserved for plug-ins. */ callback = frm; hsi.SetHost("localhost"); string result = hsi.Connect("default", "default"); hs = hsi.GetHSRef(); if (hs == null) { //Interaction.MsgBox("Unable to access HS interface", MsgBoxStyle.Critical); // UNABLE TO CONNECT TO HOMESEER } else { InterfaceVersion = hs.InterfaceVersion(); } hsi.RegisterEventCB(4, this); Test(); } public void HSEvent(int evtype, object[] parms) { string dc = null; dc = parms.ElementAt(0).ToString(); hs.WriteLog(IFACE_NAME, "Something happened " + dc); }
Comment