Can anyone give me the compiled dll file? I'm having huge trouble getting VC++ to compile the project. Also, could the author maybe post them so everyone can d/l it? My email is email@example.com
One thing may occur: Outlook may send an "IStorage" pointer
instead of the "IStream" pointer. In this case, you simply
create an "IStorage" pointer which _is_ a file, and use the
HRESULT StorageToFile(IStorage *storage, CString FileName)
// create another IStorage that _is_ a file!!!
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
// copy source storage to the file storage
One thing that I am interested in: What about other mail
programs like Netscape, Eudora, Lotus etc.? I did read
that they have their own clipboard formats; you can check that here:
http://www.unitoops.com/uoole/examples/emailtest.htm (it is Delphi code, but you may convert it in C++). If
anyone has there a solution, too, please let me know
I am using this control with Visual Foxpro 7 and have run into a peculiar problem. The attachment can be dragged to the control, but is not written to disk on the first drop. If I drag and drop again, then it is written.
Subsequent drops are written as well. However, the control refuses to recognize and drops after 4 drag/drop events. This is consistent.
Unfortunately, Foxpro does not behave with C++/VB controls as well as it should. The events are not visible unless I DEFINE my own classes from the control and create a separate class just for the events. What a pain.
My work around is to use a timer to look into the directory where the files are dropped and then clear and add the files to a listbox.
I also implemented separate storage for the descriptor and contents in the DragDropObject::Drop(). Did not see any improvement. Have not experienced any memory leaks.
Anyone have any ideas why the control would shut off after 4 events?
I've used Kraig Hiersche's C++ component and it works fine. However I am wondering if anyone has come across something similar using Visual Basic instead? I figure that since his article was posted in 1999 someone might have figure out something else.
Thanks for this. It got me started. I spent several hours debugging it and fixed several bugs.
1. Memory leak. A separate storage should be used for the descriptor and the contents. As it is now, the descriptor is never free because the pointers to it are overwritten when the contents are retrieved.
2. GetData always failed. When I removed the calls to QueryGetData, it worked. If you remove the calls to QueryGetData, be sure to always check the return values of GetData.
I also changed it to support both CFSTR_FILEDESCRIPTORA and CFSTR_FILEDESCRIPTORW (the unicode version). The zip viewer that comes with Windows XP uses CFSTR_FILEDESCRIPTORW, while Outlook usually uses CFSTR_FILEDESCRIPTORA.
This solution work only if attachment is an IStream, otherwise the contents is available in DataObject.Files collection.
When you drag from Explorer, DataObject.GetFormat(vbCFFiles) is True, but if you drag from Outlook (not Outlook Express) then DataObject.GetFormat(vbCFFiles) is False because the attachment is not a file (file system) is an IStream.