Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - BUG: Drag&Drop enabled with all rows selected
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

BUG: Drag&Drop enabled with all rows selected

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: BUG: Drag&Drop enabled with all rows selected
    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 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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;

}

Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2009 at 6:37pm
Sure but if you select all to drop in another control? This is proper operation.
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2009 at 2:32am
Fortunately, this is also not allowed in this application
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
You can run 2 instances same time and check internal and external drag and drop
 
To use standard mode - uncheck menu - Edit - Vista DD
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.