[solved] FlowGraph Bug |
Post Reply |
Author | ||||
cluster
Groupie Joined: 22 January 2015 Status: Offline Points: 91 |
Post Options
Thanks(0)
Posted: 15 November 2017 at 6:42am |
|||
Hello,
I figured out that CXTPFlowGraphConnection objects will not deleted if I block the "add" process. So, if I return a *pResult = -1 in a XTP_FGN_CONNECTIONCHANGED NotifyMessage the connection will not deleted. I triggered a ASSERT message in CXTPFlowGraphConnectionPoint::OnRemoved() // Removed Connections should update them ASSERT(m_arrInputConnections.GetSize() == 0); ASSERT(m_arrOutputConnections.GetSize() == 0); Windows 7, Visual Studio 2010, Toolkit Pro 17.3.0 |
||||
Windows 7
Visual Studio 2013 CodeJock 18.6 |
||||
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
|||
Hello cluster,
For preventing adding connection you should handle XTP_FGN_CONNECTIONCHANGING NotifyMessage which used during changing. XTP_FGN_CONNECTIONCHANGED used after changes. Regards, Oleksandr Lebed |
||||
cluster
Groupie Joined: 22 January 2015 Status: Offline Points: 91 |
Post Options
Thanks(0)
|
|||
Hello Oleksandr,
thank for your reply. The order of the messages is: 1. StartDragConnectionPoint (DragEnter) -> Create a Connection -> Send the XTP_FGN_CONNECTIONCHANGED message 2. WM_MOUSEMOVE (DragOver) -> Send the XTP_FGN_CONNECTIONCHANGING message 3. (Drop) -> there is no message anymore! And I want to block the starting process, of course I could deviate from the control class, but I thought therefor there are these messages. |
||||
Windows 7
Visual Studio 2013 CodeJock 18.6 |
||||
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
|||
Hello cluster, There is really sophisticated situation with these notifications. I think it is because creating connection is complex action. First XTP_FGN_CONNECTIONCHANGED notification is about creation temporary Connection object pDragConnection (method CXTPFlowGraphControl::StartDragConnectionPoint), which will be deleted at the end of method if end point (InputPoint) is empty. To allow your algorithm works (prevent even starting of creation new connection) and to correct handling canceling in notification we need to add handling "*pResult = -1" in StartDragConnectionPoint(). One of way is checking CXTPFlowGraphConnection::m_nConnectionIndex of new connection or other member CXTPFlowGraphConnection::m_pPage with public getter GetPage().
Such conditions should be added in CXTPFlowGraphUndoDeleteConnectionCommand::Undo
The reason of assertions in CXTPFlowGraphConnectionPoint::OnRemoved() is because you don't allow addition new connection in AddConnection() but then you call SetInputPoint() or SetOutputPoint()
in such code should be added checking results of AddConnection()
Regards, Oleksandr Lebed
|
||||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |