PRoblem in COnnectionPOint

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sugee
    New Member
    • Jan 2007
    • 35

    #1

    PRoblem in COnnectionPOint

    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 .InteropService s.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.DateTim e.Today.Year,5, 11,3,10,12);
    Object dtobj=(System.O bject)dt;
    Object obj=new Object();

    PATTERNSRTEMGRL ib.PtRTEngineMa nagerClass EngMgr=new PtRTEngineManag erClass();
    PATTERNSRTELib. PtRTEngine Eng=(PATTERNSRT ELib.PtRTEngine )EngMgr.CreateE ngine("LAM1200" );
    PATTERNSRTELib. IPtRTEngineSetu p6 setup=(PATTERNS RTELib.IPtRTEng ineSetup6)Eng;
    PATTERNSRTELib. IPtRTEngineCont rol Engctrl= (PATTERNSRTELib .IPtRTEngineCon trol)Eng;

    UCOMIConnection PointContainer icpc1=(UCOMICon nectionPointCon tainer)setup;
    UCOMIConnection PointContainer icpc2=(UCOMICon nectionPointCon tainer)Engctrl;
    UCOMIConnection Point icp,icp1;

    Guid IID_IMyEvents1 = typeof(_IPtRTEn gineEvents).GUI D;
    icpc1.FindConne ctionPoint(ref IID_IMyEvents1, out icp);

    //Guid IID_IMyEvents2 = typeof(_IPtRTEn gineEvents).GUI D;
    icpc2.FindConne ctionPoint(ref IID_IMyEvents1, out icp1);

    if(icp.Equals(n ull) & icp1.Equals(nul l))
    MessageBox.Show ("No connection Established");

    icp.Advise(mySi nk1,out cookie1);
    icp1.Advise(myS ink2,out cookie2);

    if(cookie1.Equa ls(0)& cookie2.Equals( 0))
    MessageBox.Show ("No Connection Point");
    int nDataBufSize = 4096;
    int nPatternsBufSiz e = 4096;
    int nContextBufSize = 2048;
    string TemplateLibsPat h = "\\..\\..\\test data\\libraries \\demo";
    //MessageBox.Show (dtobj.GetType( ).ToString());
    setup.SetBufSiz es(nDataBufSize ,nPatternsBufSi ze ,nContextBufSiz e);
    setup.SetTempla teLibrary(Templ ateLibsPath);

    //Engctrl.SetAlar m(9.02,"a");
    Engctrl.StartEn gine(null);

    icp1.Unadvise(c ookie2);
  • sugee
    New Member
    • Jan 2007
    • 35

    #2
    can anyone suggest me to get rid of this error?

    Comment

    • kenobewan
      Recognized Expert Specialist
      • Dec 2006
      • 4871

      #3
      Suggest debugging. Here is an article that may help:
      COMexception Class

      Comment

      Working...