Hi, am trying to implement connectionpoint in my appln. where in i try calling a method in my server. this throws an error An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in ATS.exe
Additional information: Variables are not initialized. the code is as follows:
Sink mySink1=new Sink();
Sink mySink2=new Sink();
int cookie1,cookie2;
System.DateTime dt=new System.DateTime(System.DateTime.Today.Year,5,11,3, 10,12);
Object dtobj=(System.Object)dt;
Object obj=new Object();
PATTERNSRTEMGRLib.PtRTEngineManagerClass EngMgr=new PtRTEngineManagerClass();
PATTERNSRTELib.PtRTEngine Eng=(PATTERNSRTELib.PtRTEngine)EngMgr.CreateEngine ("LAM1200");
PATTERNSRTELib.IPtRTEngineSetup6 setup=(PATTERNSRTELib.IPtRTEngineSetup6)Eng;
PATTERNSRTELib.IPtRTEngineControl Engctrl= (PATTERNSRTELib.IPtRTEngineControl)Eng;
UCOMIConnectionPointContainer icpc1=(UCOMIConnectionPointContainer)setup;
UCOMIConnectionPointContainer icpc2=(UCOMIConnectionPointContainer)Engctrl;
UCOMIConnectionPoint icp,icp1;
Guid IID_IMyEvents1 = typeof(_IPtRTEngineEvents).GUID;
icpc1.FindConnectionPoint(ref IID_IMyEvents1,out icp);
//Guid IID_IMyEvents2 = typeof(_IPtRTEngineEvents).GUID;
icpc2.FindConnectionPoint(ref IID_IMyEvents1,out icp1);
if(icp.Equals(null) & icp1.Equals(null))
MessageBox.Show("No connection Established");
icp.Advise(mySink1,out cookie1);
icp1.Advise(mySink2,out cookie2);
if(cookie1.Equals(0)& cookie2.Equals(0))
MessageBox.Show("No Connection Point");
int nDataBufSize = 4096;
int nPatternsBufSize = 4096;
int nContextBufSize = 2048;
string TemplateLibsPath = "\\..\\..\\testdata\\libraries\\demo";
//MessageBox.Show(dtobj.GetType().ToString());
setup.SetBufSizes(nDataBufSize,nPatternsBufSize ,nContextBufSize);
setup.SetTemplateLibrary(TemplateLibsPath);
//Engctrl.SetAlarm(9.02,"a");
Engctrl.StartEngine(null);
icp1.Unadvise(cookie2);