 |
|
 |
It does not work, when drag Outlook attach
|
|
|
|
 |
|
|
 |
|
 |
VC6.0
My Application: the same window explore
I cut 2 files in window explore, then in my application
I paste them there. How to know that:
1. 2 files are cutting
2. Path is exist
3. ListCtrl control: how to sort folders are top, files are bottom
Thanks
|
|
|
|
 |
|
 |
VC6.0
My application: the same window explore
I cut 2 files in window explore, then in my application I paste them there. How to know that:
1. these files is cutting. Which attribute?
2. path is exist. Which function?
3. ListCtrl : how to sort folders is top, files is bottom as window explore
|
|
|
|
 |
|
 |
VC6.0(MFC): My Application: the same window explore
1.I cut 1 file in window explore, then in my application I paste it. How to know "that file is cutting"? Which attribute?
2.How to know " a path is exist ?".Which function
3.ListCtrl control : how to sort to folders is top, files is bottom?
Thanks
|
|
|
|
 |
|
 |
I'm using Windows XP SP2 and I don't get drag images to show up in the demo project. I can get them to show up in the treeview if I create an imagelist and assign it into the tree. - I don't need to add any images to the list, just creating and assigning is enough.
But then a different problem manifests. If the dragsource creates an image, the hit test doesn't find any tree items. The test works just fine if we don't create the drag image, but if we do...
I'm not even sure WHY it would be failing. Does the hit test window somehow consider the drag image to be part of the window, and so the point falls inside the rect of the image? I've tried offsetting the drag image, but to no avail.
Any ideas?
(Other than that, great set of classes )
|
|
|
|
 |
|
 |
I believe the problem w/ no 'drag images' has to do w/ the Windows Display Properties >> Effects tab ---> 'Show window contents while dragging' checkbox. If it is not set, no drag images. I had the same problem until I checked this box.
|
|
|
|
 |
|
 |
Hello:
I download this example. I drop in the DragDropImpl.h and DragDropImpl.cpp. I get a compile errors.
DragDropImpl.cpp(606) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Can any one point out what need to be change to get it compile.
Mike
|
|
|
|
 |
|
 |
Does anybody know how to use DragDropImpl.h and DragDropImpl.cpp in MFC project? It didn't compile ok when I added both files to my MFC project.
Thanks for your help...
|
|
|
|
 |
|
 |
Hello
I have one problem. For some reason IDragSourceHelper::InitializeFromBitmap always return E_FAIL. It's seems IDragSourceHelper doesn't work at all on W2K Server (maybe on 2003 Server too ?). At the same time this code work prefect on w2k professional and windows XP.
Any suggestions?
|
|
|
|
 |
|
 |
Hi, sorry to bother you again. But I've been working mostly on XP here with my program, but at this moment I'm testing it on Windows 2000. And the drag image does not appear. It doesn't do that in your demo project either.
Do you know anything about this problem? According to the documentation in msdn it should be supported. What've you been working with yourself? If you're also using 2000, then perhaps it's a problem with the computer over here.
Thanks.
|
|
|
|
 |
|
 |
Hi,
Interesting, there was one of the previous posts saying "No drag image on XP"
I've been using Windows 2000 and the image was there. But I've upgraded to Windows XP since then. I'll try next week when I have access to Win2k and let you know.
Thanks a lot
|
|
|
|
 |
|
 |
Yea, I saw that one too hehe.
Thanks for taking your time on testing it, I'd really appreciate it. I'll see if I can get someone to test it on another win2k machine in the meantime.
|
|
|
|
 |
|
 |
I tried it on win2k (sp4+latest updates). Both IDragSourceHelper::InitializeFromBitmap and IDragSourceHelper::InitializeFromWindow return E_FAIL. I remembered, it
did work on win2k that i used for development. You can see it from screenshot.
Maybe one of updates breaks it? Or maybe it doesn't like the bitmap given to it.
|
|
|
|
 |
|
 |
I don't know. I'm testing with SP3 here now, and it doesn't work.
I put in some debug lines, and GetLastError returns error #8: "Not enough storage is available to process this command.". Although I'm not so sure if this makes any sense when it comes to OLE.
The HRESULT returned ended up being an "Unspecified error". So that isn't very helpful either
|
|
|
|
 |
|
 |
thanks for the great aticle first
i found that
once drag image got out of the DragDrop window, its image is
changed to DEFAULT drag image
draging image is supposed to preserve itself out of the drag source dialog( DragDrop dialog in demo)??
is that right behavior?
actually i would like to preserve original drag image anyplace out of the the original drag source window?
any solution??
|
|
|
|
 |
|
 |
Yes that's the correct behavior. The mouse cursor state is controlled by whatever drop target window the mouse is over and by the responses of that drop target. Otherwise how would user know if they can drop on underlying window or not? You can most likely change the default behavior. To provide your own cursor return S_OK from GiveFeedback. And draw image manually if you want it.
|
|
|
|
 |
|
 |
thanks for the advice
one more beginner question..
where shoud i put the "draw image" code in your code(reusable dnd code).
some hints would be appreciated. i hope its not too much bother though
anyway i think i have to google for some sample codes, "creating custom
drag image"
thanks alot again
|
|
|
|
 |
|
 |
I never tried it myself. Try putting the code in GiveFeedback and returning S_OK
|
|
|
|
 |
|
 |
Hi, first of all: Great class!
Second: I had access violations when using it in an MFC project. The problem is the CEnumFormatEtc class. You've created on of your own, but apparently MFC also implements a class with the same name. So every time AddRef was called in CIDataObject::EnumFormatEtc() it somehow ended up in the destructor of MFC's version of CEnumFormatEtc (don't ask me how). Anyway, this kept raising an access violation all the time.
As a solution, I put all your classes in a seperate namespace, and that seemed to solve the problem.
|
|
|
|
 |
|
 |
Hi,
It's probably a good idea to bypass custom implementation of IEnumFORMATETC and use CreateFormatEnumerator instead:
http://msdn.microsoft.com/workshop/networking/moniker/reference/functions/createformatenumerator.asp
I only saw this function after the fact, otherwise I would have probably used it instead of custom implementation
Thanks a lot for the comments
|
|
|
|
 |
|
 |
Another thing. In the function CIDropTarget::QueryDrop() there is the part where you try to figure out what kind of drop effects are possible:
[code]
if(*pdwEffect == 0)
{
// ...
}
[/code]
The first thing you test for is whether there's a copy operation possible. Here a problem arises, if a drop target would accept both copy and move operations, the default action is copy instead of move. As far as I know, move would be the default operation if no modifier keys are being pressed (CTRL in particular).
The solution is simple, just switch the tests like this:
[code]
if (DROPEFFECT_MOVE & dwOKEffects)
*pdwEffect = DROPEFFECT_MOVE;
else if (DROPEFFECT_COPY & dwOKEffects)
*pdwEffect = DROPEFFECT_COPY;
[/code]
This way the default operation will become move, and copy will be the default when CTRL is held.
PS. How the heck do I get code sections without the <pre> tags? UBB doesn't seem to be working :/
Well, maybe UBB just doesn't work for me
|
|
|
|
 |
|
 |
oops Thanks for spotting this I think <pre> tag is the way
|
|
|
|
 |
|
 |
Eacht DragDrop Action (to an other application) leaves the CIDropSource.
The ReferenceCount of the CIDropSource is zero but the debugger dumps it!?
Detected memory leaks!
Dumping objects ->
{452} normal block at 0x00B47C28, 12 bytes long.
Data: < $b > 88 24 62 00 00 00 00 00 01 CD CD CD
Object dump complete.
Does anybody know the reason for this?
FPF
|
|
|
|
 |
|
 |
Hello, Are you using demo project from the article or your own code? I would suggest using new atldbgmem.h in atl7+ To use it in demo project, just include these two lines before any other includes in stdafx.h: #include <windows.h> #include <atldbgmem.h>
Put this line at the end of your WinMain, in demo project DragDrop.cpp: AtlDumpMemoryLeaks();
Run in debug mode (F5). Try same drag & drop as before. Exit the app normally. Then in the output window you should get the filename and line number that is causing the leak. For example i tried the demo project from this article, it only showed leaks from atlbase.h CDynamicStdCallThunk::Init. And it's only because global CAppModule _Module; is not destroyed yet at the point when dump memory leaks is called. If you do this for testing purposes in DragDrop.cpp: CAppModule _Module; struct C { ~C(){AtlDumpMemoryLeaks();} }; Then no leaks show up.
I hope that helps
|
|
|
|
 |