Board index » cppbuilder » Drag&Drop from the Desktop
Florian Pos
![]() CBuilder Developer |
Fri, 30 May 2003 07:44:18 GMT
|
Florian Pos
![]() CBuilder Developer |
Fri, 30 May 2003 07:44:18 GMT
Drag&Drop from the Desktop
Hi !
I'm trying to drag files from the desktop in one of my listviews. It is no Thanx, Florian |
Remy Lebea
![]() CBuilder Developer |
Fri, 30 May 2003 09:12:19 GMT
Re:Drag&Drop from the DesktopBecause most likely, you are using the Drag&Drop features already built into your ListViews, right? Those are implemented and controlled entirely by the VCL specifically for the task of drag&dropping between VCL components within the same application. However, the kind of Drag&Drop you are asking about and need to use is the Gambit Quote"Florian Pose" <flor...@maculaweb.de> wrote in message Quote> I'm trying to drag files from the desktop in one of my listviews. It is no |
Florian Pos
![]() CBuilder Developer |
Fri, 30 May 2003 18:14:45 GMT
Re:Drag&Drop from the DesktopHey, Thanks ! Now I know, that I have to register my ListView as an OLE drop target. But I IDroptarget *Droptarget; Can you help me further ? Thanx a lot, Florian Remy Lebeau <gambi...@gte.net> schrieb in im Newsbeitrag: Quote> Because most likely, you are using the Drag&Drop features already built |
Rony Cesan
![]() CBuilder Developer |
Fri, 30 May 2003 22:54:32 GMT
Re:Drag&Drop from the Desktopgive a look here: http://bcbcaq.freeservers.com/project_DD.html rony. |
Remy Lebea
![]() CBuilder Developer |
Sat, 31 May 2003 01:20:24 GMT
Re:Drag&Drop from the DesktopIDropTarget is an interface, not a standalone class, so you have to write your own class that inherits from IDropTarget, sorry for not making that clearer before. class MyDropTarget : public IDropTarget { public: HRESULT DragEnter(IDataObject*, DWORD, POINTL, DWORD*); HRESULT DragOver(DWORD, POINTL, DWORD*); HRESULT DragLeave(void); HRESULT Drop(IDataObject*, DWORD, POINTL, DWORD*); }; HRESULT MyDropTarget::DragEnter(IDataObject *pDataObject, DWORD grfKeyState, Quote} *pdwEffect) { // your code Quote} { // your code Quote} POINTL pt, DWORD *pdwEffect) { // your code Quote} [...] RegisterDragDrop(ListView1->Handle, MDT); Gambit QuoteFlorian Pose <flor...@maculaweb.de> wrote in message Quote> Now I know, that I have to register my ListView as an OLE drop target. But |
Florian Pos
![]() CBuilder Developer |
Sat, 31 May 2003 03:24:45 GMT
Re:Drag&Drop from the DesktopAaah ! Now I understood it ! Thanx a lot ! Best regards, Florian |
Florian Pos
![]() CBuilder Developer |
Sat, 31 May 2003 19:32:10 GMT
Re:Drag&Drop from the DesktopSorry, that I'm asking once more: I declared the 4 Functions of the IDropTarget... What can it be, if my RegisterDragDrop call produces an unknown error ? Is there something I forgot to declare in the derives class ? Thank you, Remy Lebeau <gambi...@gte.net> schrieb in im Newsbeitrag: Quote> IDropTarget is an interface, not a standalone class, so you have to write |
Remy Lebea
![]() CBuilder Developer |
Sun, 01 Jun 2003 11:17:19 GMT
Re:Drag&Drop from the DesktopDoes your code call CoInitialize() or OleInitialize() anywhere before calling RegisterDragDrop()? The only other thing I can think of is to also add the following functions class MyDropTarget : public IDropTarget // the following three functions come from the IUnknown interface STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObj); Quote}; { cRefs = 0; Quote} { *ppv = NULL; if(IsEqualIID(riid, IID_IUnknown)) if (*ppv == NULL) ((LPUNKNOWN)*ppv)->AddRef(); Quote} { return ++cRefs; Quote} { if (--cRefs != 0) return cRefs; delete this; Quote} Quote"Florian Pose" <flor...@maculaweb.de> wrote in message Quote> Sorry, that I'm asking once more: |
Florian Pos
![]() CBuilder Developer |
Sun, 01 Jun 2003 20:43:19 GMT
Re:Drag&Drop from the DesktopTHANKS !! THAT WAS IT ! Now it works ! Best regards, Florian Remy Lebeau <gambi...@gte.net> schrieb in im Newsbeitrag: Quote> Does your code call CoInitialize() or OleInitialize() anywhere before |
1. Drag&drop to Win95 desktop?
2. OLE Drag&Drop vs Drag&Drop+Serialization
3. Drag Image control during drag & drop operations
4. No drop cursor in drag & drop
5. Drag and drop - from app to desktop
6. Drag n Drop Files To Desktop/Apps (Delphi 3)
7. Drag-and-Drop Desktop Icons
8. Drag and drop between desktop/explorer and Delphi 3.0 app