Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Drag and Drop

Drag and Drop

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Luke Murray
    wrote on last edited by
    #1

    hello, I'm trying to implement drag and drop in my program, i'm using the drag nd drop classes by Leon Finker on CP. I had it working then noticed it now doesn't work, i have old source where it does work, but apart from things i changed in ftp classes etc there is not differnces, i've even copied the to window classes that implement drag and drop to the new src, and compiled it but still drag and drop fails. it fails on RegisterDragDrop the code i use is: dropTarget = new DropTarget(m_hWnd); if (dropTarget == NULL) return false; dropTarget->AddRef(); if (FAILED(RegisterDragDrop(m_hWnd, dropTarget))) { dropTarget = NULL; return false; } ... This is from the drag and drop example Leon provides. and RegisterDragDrop always fails, but not in the other source, really annoying me. Anyone got any ideas of what this could be from? been trying to figure it out for ages! thanks in advance for any help. Luke EDIT: I'm using the WTL framework if that helps or matters

    L 1 Reply Last reply
    0
    • L Luke Murray

      hello, I'm trying to implement drag and drop in my program, i'm using the drag nd drop classes by Leon Finker on CP. I had it working then noticed it now doesn't work, i have old source where it does work, but apart from things i changed in ftp classes etc there is not differnces, i've even copied the to window classes that implement drag and drop to the new src, and compiled it but still drag and drop fails. it fails on RegisterDragDrop the code i use is: dropTarget = new DropTarget(m_hWnd); if (dropTarget == NULL) return false; dropTarget->AddRef(); if (FAILED(RegisterDragDrop(m_hWnd, dropTarget))) { dropTarget = NULL; return false; } ... This is from the drag and drop example Leon provides. and RegisterDragDrop always fails, but not in the other source, really annoying me. Anyone got any ideas of what this could be from? been trying to figure it out for ages! thanks in advance for any help. Luke EDIT: I'm using the WTL framework if that helps or matters

      L Offline
      L Offline
      Luke Murray
      wrote on last edited by
      #2

      Ok, very strange I have 2 list views that are trying to do the drag and drop, i also have a RichEditCtrl and in its create method it calls its SetReadOnly(TRUE); method. which makes RegisterDragDrop fail. So i put the readonly bit in the RichEdit.create(..., ES_READONLY) bit but that makes RegisterDragDrop fail. I think this is very weird, the RichEdit.create method gets called before the to listview get created, i'll try swaping them but, still this shouldn't be happening. any ideas? Luke.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups