Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Unhandled exception (Read 1826 times)
MagnusSpeychal
Junior Member
**
Offline



Posts: 53
Joined: Jun 18th, 2007
Unhandled exception
Jul 6th, 2007 at 8:19am
Print Post  
Hi

I have created a number of boxes. Some of the boxes has "UserData" set to -1. Everyone of these boxes is grouped with ONE of the other boxes. When a box with "UserData"=-1 is selected I use the BoxSelected() event to draw an arrow from the selected box to the master object in the group (to visually show the user which box the selected box belongs to). This works fine. However, when the box is deselected I use the BoxSelectionLost() event to delete the arrow. This gives me an unhandled exception for some reason. Sad

Any idea why this happens? I use the detachdispatch() function for both events.


Best regards,
Magnus
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Unhandled exception
Reply #1 - Jul 6th, 2007 at 9:45am
Print Post  
Hi,

It seems it is not safe to delete items from SelectionLost. We will have to add some validation code after the event is raised to check whether items have been deleted. Until we fix this, you can set some boolean flag indicating that a box is deselected, and delete the corresponding arrow from the MouseUp event handler. You might also have to set FlowChart.EventFlags[fFireMouseUpAfterModfProcessing] to true.

Stoyan
  
Back to top
 
IP Logged
 
MagnusSpeychal
Junior Member
**
Offline



Posts: 53
Joined: Jun 18th, 2007
Re: Unhandled exception
Reply #2 - Jul 6th, 2007 at 9:53am
Print Post  
Hi Stoyan

Thanks for your answer!
I will try the solution you propose.


Best regards,
Magnus
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint