Print Page | Close Window

BUG: Drag&Drop enabled with all rows selected

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=14895
Printed Date: 10 May 2024 at 4:40am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: BUG: Drag&Drop enabled with all rows selected
Posted By: mgampi
Subject: BUG: Drag&Drop enabled with all rows selected
Date Posted: 03 August 2009 at 11:36am
Hi;

when all rows within a report control are selected then Drag&Drop within the same control is possible, resulting in an access violation!
I think this should be disabled by default.


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



Replies:
Posted By: mdoubson
Date Posted: 03 August 2009 at 4:21pm
You right - let's change a few lines in function

BOOL CXTPReportControl::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)

...........................................................................
if (m_bDragMode && dropEffect == DROPEFFECT_MOVE)

{

if (nDropPos == -1)

return FALSE;

CXTPReportRecords* pDropRecords = new CXTPReportRecords(TRUE);

if (!_GetSelectedRows(pDropRecords)

|| pDropRecords->GetCount() == GetRows()->GetCount()) //EXTRA CONDITION

{

CMDTARGET_RELEASE(pDropRecords);

return FALSE;

}



-------------
Mark Doubson, Ph.D.


Posted By: mgampi
Date Posted: 03 August 2009 at 5:40pm
Hi;
I'm still using v12.1.1 and partly v13.0, so I will wait until 13.1.1 will be available.
Meanwhile I solved it in LVN_BEGINDRAG handler of my report control parent window and prevent this completely by returning *pResult=TRUE


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: mdoubson
Date Posted: 03 August 2009 at 6:37pm
Sure but if you select all to drop in another control? This is proper operation.

-------------
Mark Doubson, Ph.D.


Posted By: mgampi
Date Posted: 04 August 2009 at 2:32am
Fortunately, this is also not allowed in this application


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: znakeeye
Date Posted: 05 August 2009 at 7:04pm
Sigh...

//<<>>

if (m_nDropPos == -1) <--- disaster

return FALSE;

If I drag records from control A to control B, nothing happens. m_nDropPos is -1...


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: znakeeye
Date Posted: 05 August 2009 at 7:05pm
I think you need to improve your report sample. Add another report control etc, so that these things can be tested easily.

-------------
PokerMemento - http://www.pokermemento.com/


Posted By: mdoubson
Date Posted: 05 August 2009 at 7:08pm
Right - this is why I post yesterday somewhere link to simple sample - https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStatic.rar - https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStatic.rar
You can run 2 instances same time and check internal and external drag and drop
 
To use standard mode - uncheck menu - Edit - Vista DD


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 05 August 2009 at 9:53pm

>> if (m_nDropPos == -1) <--- disaster

m_nDropPos generated during OnDragOver - so it irrelevant internal or external Drag source


-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net