?
Solved

drop and drap

Posted on 2011-10-20
7
Medium Priority
?
243 Views
Last Modified: 2012-05-12
I would like to drop and drap a file from an email onto an apps dialog box and then put the file in a specific location.  Could you pont me to a good example.  This will be a license file that comes in any email after a product ispurchased.
0
Comment
Question by:artwilkes
  • 3
  • 2
  • 2
7 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 37005607
Hi artwilkes,

what kind of application is it? Do you use MFC or pure Win32 API or something else?

ZOPPO
0
 

Author Comment

by:artwilkes
ID: 37007046
Hi I use v++ and mfc.
0
 
LVL 8

Expert Comment

by:Pramod Bugudai
ID: 37016258
Hi Artwilkes,

If your app is a dialog based application then it should be quite simple. On your dialog you can put a list box or list control and then programming for it to handle drag and drop to list out all your files moved to your app OR else you can program for directory structure with the controls to put your files directly (Drag and Drop) to the location you want.

One sample is here.
http://www.ucancode.net/Visual_C_MFC_Example/File-folder-drag-drop-vc-example-WM_DROPFILES-RegisterDragDrop.htm
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Expert Comment

by:Zoppo
ID: 37016428
I don't think it's that easy since the data format passed by a drag/drop from mail programs (at least with Outlook the data is passed via an IStream) is different than the format passed when i.e. files/folders are dragged/dropped from explorer (list to path names of existing files), so the application won't recieve a WM_DROPFILES message.

@artwilkes: What kind of window/control do you want this drag/drop functiontality to work with? If it's a CView-derived window it's a little bit easier since you can use its virtual functions OnDragOver and OnDrop and register the view for drop operations using a COleDropTarget member. Otherwise, i.e. if it's a dialog, you'll have to implement it by adding a COleDropTarget derived member to the window and implement the OnDragOver and OnDrop within this class.

ZOPPO


0
 
LVL 8

Accepted Solution

by:
Pramod Bugudai earned 1000 total points
ID: 37016922
I don't think Artwilkes is bothering about supporting the format as from the question he asked.
As per his question it should be simple drag and drop to his app and later moved to a directory.
At beginner level he should concentrate on simple drag and drop, and not COleDrag and Drop.

Pramod
0
 
LVL 31

Assisted Solution

by:Zoppo
Zoppo earned 1000 total points
ID: 37016943
artwilkes wrote: I would like to drop and drap a file from an email onto an apps dialog box...

For me this indicates the source for the drag/drop is a mail-client. If so IMO it doesn't make sense to help artwilkes implementing drag/drop of files/folders since it's not working the same ...
0
 

Author Closing Comment

by:artwilkes
ID: 37018710
Yes it's not easy, or even reliable, to drop and drag from a mail client, I am taking it to a  windows explorer or desktop first then onto the program.  Thanks for the insite.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question