Error Creating Window Handle

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pucca

    Error Creating Window Handle

    I'm gettting this error at "Application.Ru n" in the code below. The error
    message also says "Out of Memory". How can I find out more about what's
    causing this error? It just breaks there with no further information.

    static void Main()
    {
    Application.Ena bleVisualStyles ();
    Application.Set CompatibleTextR enderingDefault (false);
    Application.Run (new FormMain());
    }

    --
    Thanks.
    --
    Thanks.
  • Vadym Stetsyak

    #2
    Re: Error Creating Window Handle

    Hello, Pucca!

    Without more code it is hard to tell where the error is.
    Can you provide/describe the code in the FormMain constructor?

    PI'm gettting this error at "Application.Ru n" in the code below. The
    Perror
    Pmessage also says "Out of Memory". How can I find out more about
    Pwhat's
    Pcausing this error? It just breaks there with no further
    Pinformation.

    P static void Main()
    P {
    P Application.Ena bleVisualStyles ();
    P Application.Set CompatibleTextR enderingDefault (false);
    P Application.Run (new FormMain());
    P }

    P--
    PThanks.
    P--
    PThanks.

    --
    With best regards, Vadym Stetsyak.
    Blog: http://vadmyst.blogspot.com


    Comment

    • Pucca

      #3
      Re: Error Creating Window Handle

      I stepped through the FormMain() and when it was done it went back to
      "Application.Ru n(new FormMain());" and gave the "System.OutofMe mory Exception"
      Thanks .

      public FormMain()
      {

      InitializeCompo nent();
      // Create an instance of a ListView column sorter and assign it
      // to the ListView control.
      lvwColumnSorter = new ListViewColumnS orter();
      this.NodeDetail .ListViewItemSo rter = lvwColumnSorter ;

      //XslTransform xslt = new XslTransform();
      //xslt.Load(someS tylesheet);

      //util = DirectoryUtil.i nstance;
      //util.OnBind += new
      DirectoryUtilEv entHandler(Refr eshDirectoryHan dler);
      utilContexts = DirectoryUtil.i nstance;
      utilContexts.On Bind += new
      DirectoryUtilEv entHandler(Refr eshDirectoryHan dler);
      //FormMain.Active Form.Text = "PowerPassw ord [" +
      util.rootContai ner.Name + "]";

      //XmlTranslationR eader msgRader = new
      XmlTranslationR eader(@"C:\PROJ ECTS\PPGLOBAL\U nityMessages.xm l");

      //XmlTextReader msgReader = null;
      string m1 = "test";
      try
      {

      //unityMessages = new XPathDocument(@ "C:\Program Files\Symark
      Software\UnityA dminSetUp\Unity Messages.xml");
      string applPath = Application.Sta rtupPath;
      unityMessages = new XPathDocument(a pplPath +
      @"\UnityMessage s.xml");
      unityMsgNavigat or = unityMessages.C reateNavigator( );

      string query =
      @"xliff/trans-unit[@id=""m1""]/target[lang(""fr"")](/root/element)";

      //XPathExpression queryM1 = unityMsgNavigat or.Compile(quer y);
      //m1 = (string)unityMs gNavigator.Eval uate(queryM1);

      //XPathNodeIterat or ni =
      (XPathNodeItera tor)unityMsgNav igator.Evaluate (queryM1);

      //int count = ni.Count;
      //while (ni.MoveNext())
      //{
      // MessageBox.Show (ni.Current.ToS tring());
      //}



      //string query = @"/trans-unit[@id=""m1""]/target[lang(""fr"")]";
      //@"/xliff/trans-unit[@id=""m1""]/target[lang(""fr"")]"
      //m1 = (string)unityMs gNavigator.Eval uate(queryM1);
      //Load the reader with the XML file.
      //reader = new XmlTextReader(" UnityMessages.x ml");
      //Read the m1 message
      //reader.MoveToCo ntent();
      //m1 = reader.GetAttri bute("m2.en-us");
      //string query =
      @"xliff/trans-unit[@id=""m1""]/target[@xml:lang=""fr" "]";
      //string query =
      @"/error-messages[@xml:lang=""en" "]/msg[@myId=""2""]/text";


      //m1 = msgReader.GetTr anslations("m1" , "en-us");
      //m1 = reader.GetAttri bute("id");

      }
      catch (Exception e)
      {
      MessageBox.Show (e.ToString(), "Unity", MessageBoxButto ns.OK,
      MessageBoxIcon. Error);
      }

      NodeDetail.Larg eImageList = unityImageList;
      NodeDetail.Smal lImageList = unityImageList;
      NodeDetail.Stat eImageList = unityImageList;
      this.CreateUnit yListView();
      //Connect to the Global Directory
      adRoot = new DirectoryEntry( "GC://" +
      rootDSE.Propert ies["defaultNamingC ontext"].Value.ToString ());
      curDomain =
      rootDSE.Propert ies["defaultNamingC ontext"].Value.ToString ();
      serverName = rootDSE.Propert ies["dnsHostNam e"].Value.ToString ();
      DNSDomain = CUnityDS.GetDNS DomainName(curD omain);
      this.Text = "Unity Admin Console - [" + DNSDomain + "]";
      InitTree(curDom ain);
      }

      --
      Thanks.


      "Vadym Stetsyak" wrote:
      Hello, Pucca!
      >
      Without more code it is hard to tell where the error is.
      Can you provide/describe the code in the FormMain constructor?
      >
      PI'm gettting this error at "Application.Ru n" in the code below. The
      Perror
      Pmessage also says "Out of Memory". How can I find out more about
      Pwhat's
      Pcausing this error? It just breaks there with no further
      Pinformation.
      >
      P static void Main()
      P {
      P Application.Ena bleVisualStyles ();
      P Application.Set CompatibleTextR enderingDefault (false);
      P Application.Run (new FormMain());
      P }
      >
      P--
      PThanks.
      P--
      PThanks.
      >
      --
      With best regards, Vadym Stetsyak.
      Blog: http://vadmyst.blogspot.com
      >
      >
      >

      Comment

      • Pucca

        #4
        Re: Error Creating Window Handle

        OK, I found what's causing this error. I added some code and a new method in
        which I was passing the "TreeViewEventA rgs e" whcih was passed into my event
        method below:
        private void ppTree_AfterSel ect(object sender, TreeViewEventAr gs e)

        Once I removed the attempt to pass "e" as a para to another method, the
        error clears up. Thank you .
        --
        Thanks.


        "Vadym Stetsyak" wrote:
        Hello, Pucca!
        >
        Without more code it is hard to tell where the error is.
        Can you provide/describe the code in the FormMain constructor?
        >
        PI'm gettting this error at "Application.Ru n" in the code below. The
        Perror
        Pmessage also says "Out of Memory". How can I find out more about
        Pwhat's
        Pcausing this error? It just breaks there with no further
        Pinformation.
        >
        P static void Main()
        P {
        P Application.Ena bleVisualStyles ();
        P Application.Set CompatibleTextR enderingDefault (false);
        P Application.Run (new FormMain());
        P }
        >
        P--
        PThanks.
        P--
        PThanks.
        >
        --
        With best regards, Vadym Stetsyak.
        Blog: http://vadmyst.blogspot.com
        >
        >
        >

        Comment

        • Pucca

          #5
          Re: Error Creating Window Handle

          Actually, it's still giving me the same error message. It's happening at
          this line of code:
          " if ((e.Node.Text == "Reports") || (e.Node.Parent. Text ==
          "Reports")) "
          of:

          private void ppTree_AfterSel ect(object sender, TreeViewEventAr gs e)
          {
          TreeNodeInfo nodeInfo = (TreeNodeInfo)e .Node.Tag;
          if ((e.Node.Text == "Reports") || (e.Node.Parent. Text ==
          "Reports"))
          {
          CreateReportsLi stView(e.Node.T ext);
          }
          else
          {
          --
          Thanks.


          "Vadym Stetsyak" wrote:
          Hello, Pucca!
          >
          Without more code it is hard to tell where the error is.
          Can you provide/describe the code in the FormMain constructor?
          >
          PI'm gettting this error at "Application.Ru n" in the code below. The
          Perror
          Pmessage also says "Out of Memory". How can I find out more about
          Pwhat's
          Pcausing this error? It just breaks there with no further
          Pinformation.
          >
          P static void Main()
          P {
          P Application.Ena bleVisualStyles ();
          P Application.Set CompatibleTextR enderingDefault (false);
          P Application.Run (new FormMain());
          P }
          >
          P--
          PThanks.
          P--
          PThanks.
          >
          --
          With best regards, Vadym Stetsyak.
          Blog: http://vadmyst.blogspot.com
          >
          >
          >

          Comment

          • Pucca

            #6
            RE: Error Creating Window Handle

            Ok, this time I really found the problem. The parent node is null.
            Question, if I add a nodeB to another nodeA, doesn't nodeA automatically
            becomes the parent? If so, then how can the parent node shows up as null in
            the debug mode?
            The following code, doesn't computerDetial node's parent would be the
            reportNode?

            this.ppTree.Nod es.Add(reportNo de);
            reportNode.Node s.Add(computerD etail);

            --
            Thanks.


            "Pucca" wrote:
            I'm gettting this error at "Application.Ru n" in the code below. The error
            message also says "Out of Memory". How can I find out more about what's
            causing this error? It just breaks there with no further information.
            >
            static void Main()
            {
            Application.Ena bleVisualStyles ();
            Application.Set CompatibleTextR enderingDefault (false);
            Application.Run (new FormMain());
            }
            >
            --
            Thanks.
            --
            Thanks.

            Comment

            Working...