We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

System Stack Overflow Exception

Hello there, In my project using VS C++ .NET 2003, I new a Group, a Rectangle and a TextNode, then I append Rectangle and TextNode to group. Finally, I append the group to diagram.(all are done in code) the System Stack Overflow Exception occured when I run my program, and try to drag the group.

7 Replies

AD Administrator Syncfusion Team November 30, 2005 03:19 PM UTC

Hi Denny, I assume you are using v 3.3.0.0 or the later 3.3.0.10 build of Essential Diagram. If you are using an earlier build, please be sure to upgrade to the latest version as soon as possible. As for inserting nodes into a group, please try to first add the Rectangle and TextNodes directly to the diagram, and then use the Syncfusion.Windows.Forms.Diagram.GroupCmd command class to create a group composed of the required nodes. The following code shows how to go about this, GroupCmd grpcmd = new GroupCmd(); grpcmd.Nodes.Add(mytxtnode); grpcmd.Nodes.Add(myrectnode); this.diagram1.Controller.ExecuteCommand(grpcmd); Please let us know if the above implemnetation poses the same problem as well. Thanks Prakash Surendra Syncfusion Inc.,


DH Denny Huang December 1, 2005 04:17 AM UTC

Hi Prakash, It still poses the same problem after following you direction. Here is my code snippet: Syncfusion::Windows::Forms::Diagram::Rectangle* partiBound = new Syncfusion::Windows::Forms::Diagram::Rectangle(x, y, x+width, y+height); TextNode* nameNode = new TextNode(S"NameText"); diagram1->Model->AppendChild(partiBound); diagram1->Model->AppendChild(nameNode); GroupCmd* grpcmd = new GroupCmd(); grpcmd->Nodes->Add(partiBound); grpcmd->Nodes->Add(nameNode); this->PathDiagram->Controller->ExecuteCommand(grpcmd); >Hi Denny, > >I assume you are using v 3.3.0.0 or the later 3.3.0.10 build of Essential Diagram. If you are using an earlier build, please be sure to upgrade to the latest version as soon as possible. > >As for inserting nodes into a group, please try to first add the Rectangle and TextNodes directly to the diagram, and then use the Syncfusion.Windows.Forms.Diagram.GroupCmd command class to create a group composed of the required nodes. The following code shows how to go about this, > >GroupCmd grpcmd = new GroupCmd(); >grpcmd.Nodes.Add(mytxtnode); >grpcmd.Nodes.Add(myrectnode); > >this.diagram1.Controller.ExecuteCommand(grpcmd); > >Please let us know if the above implemnetation poses the same problem as well. > >Thanks >Prakash Surendra >Syncfusion Inc.,


DH Denny Huang December 1, 2005 08:06 AM UTC

I did some experiment: Only put TextNode in a Group, and it threw the exception when I dragged the group.


AD Administrator Syncfusion Team December 2, 2005 11:07 PM UTC

Denny, Thanks for the updated information. I will check this condition out, and update you as soon as possible. Thanks, Prakash Surendra Syncfusion Inc.,


AD Administrator Syncfusion Team December 8, 2005 10:23 PM UTC

Hey Denny, I was able to reproduce this problem. It was on account of the TextNode not having a size specified for it. You can workaround the condition by calling the TextNode.SizeToText(SizeF) method right after creating the TextNode, so that it has a valid bounds value associated with it when it is inserted into the diagram. The following code should give you an idea, TextNode txtnode = new TextNode("Hello World"); txtnode.SizeToText(new SizeF(500,50)); InsertNodesCmd inscmd = new InsertNodesCmd(); inscmd.Location = new PointF(50,50); inscmd.Nodes.Add(txtnode); this.diagramComponent.Controller.ExecuteCommand(inscmd); GroupCmd grpcmd = new GroupCmd(); grpcmd.Nodes.Add(txtnode); this.diagramComponent.Controller.ExecuteCommand(grpcmd); I believe we already have a QA report on the TextNode class related to this issue. I will up the priority on the problem, and we will definitely fix this issue in a future release of the product. Thanks, Prakash Surendra Syncfusion Inc.,


DH Denny Huang December 9, 2005 04:14 AM UTC

Hi Prakash, Thanks for your reply. Unfortunatelt, it still doesn''t work. the error can be reproducted using VC++ .NET. Here is the VC++ code (modified from yours). Please help. Denny //////////////// TextNode* txtnode = new TextNode("Hello World"); txtnode->SizeToText(SizeF(500,50)); InsertNodesCmd* inscmd = new InsertNodesCmd(); inscmd->Location = PointF(50,50); inscmd->Nodes->Add(txtnode); this->diagram1->Controller->ExecuteCommand(inscmd); GroupCmd* grpcmd = new GroupCmd(); grpcmd->Nodes->Add(txtnode); this->diagram1->Controller->ExecuteCommand(grpcmd); ///////////////////// >Hey Denny, > >I was able to reproduce this problem. It was on account of the TextNode not having a size specified for it. You can workaround the condition by calling the TextNode.SizeToText(SizeF) method right after creating the TextNode, so that it has a valid bounds value associated with it when it is inserted into the diagram. The following code should give you an idea, > >TextNode txtnode = new TextNode("Hello World"); >txtnode.SizeToText(new SizeF(500,50)); > >InsertNodesCmd inscmd = new InsertNodesCmd(); >inscmd.Location = new PointF(50,50); >inscmd.Nodes.Add(txtnode); >this.diagramComponent.Controller.ExecuteCommand(inscmd); > >GroupCmd grpcmd = new GroupCmd(); >grpcmd.Nodes.Add(txtnode); >this.diagramComponent.Controller.ExecuteCommand(grpcmd); > >I believe we already have a QA report on the TextNode class related to this issue. I will up the priority on the problem, and we will definitely fix this issue in a future release of the product. > >Thanks, >Prakash Surendra >Syncfusion Inc.,


AD Administrator Syncfusion Team December 13, 2005 04:51 PM UTC

Denny, My tests were conducted on a machine running the 4.1 beta codebase, and calling TextNode.SizeToText() seemed to take care of the problem. Did you get a chance to try out this issue with the 4.1 beta? Did the new version make a difference? Thanks, Prakash Surendra Syncfusion Inc.,

Loader.
Live Chat Icon For mobile
Up arrow icon