Originally posted by: Jeff Scherrer
I experienced compiling errors when making the VC DLL. I'm trying really hard to do this in VB. Can someone e-mail me the compiled DLL please? Thank you.
Jeff
Originally posted by: kv ramana
Hi,
I have the same problem in my .NET application. How to handle Drag & Drop of OutLook attachments in .NET application?
Thanks,
Ramana
Originally posted by: Kath Chapman
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 trekkies@internode.on.net
Thanks!
ReplyOriginally posted by: Thomas Elsaesser
But then I found the complete documentation about
One thing may occur: Outlook may send an "IStorage" pointer
HRESULT StorageToFile(IStorage *storage, CString FileName)
// copy source storage to the file storage
return S_OK;
One thing that I am interested in: What about other mail
So: Keep on coding!
First of all: thank you for posting your code, it was very worthy for me.
"Handling Shell Data Transfer Scenarios" in MSDN, which is
a complete documentation of all these clipboard formats:
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/transferring/datascenarios.asp
And Outlook use the standard
mechanism with CFSTR_FILECONTENTS/CFSTR_FILEDESCRIPTOR.
instead of the "IStream" pointer. In this case, you simply
create an "IStorage" pointer which _is_ a file, and use the
function "CopyTo":
{
// create another IStorage that _is_ a file!!!
IStoragePtr stgFile;
CComBSTR bstrFileName=FileName.AllocSysString();
HRESULT hr;
if(FAILED(hr=StgCreateDocfile(bstrFileName.m_str,
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
0,&stgFile)))
return hr;
if(FAILED(hr=storage->CopyTo(0,NULL,NULL,stgFile)))
return hr;
}
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
(Email...).
Originally posted by: David Ballard
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?
Thanks.
ReplyOriginally posted by: Jeanny Collazo
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.
ReplyOriginally posted by: Yves Motte
I'm getting a error while i'm compiling the source file. I don't know much of C++... Can anyone send me the DLL?
thanks, really appreciated
Yves
YMotte@falconbridge.com
Originally posted by: MathWhiz
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.
Reply
Originally posted by: Vittorio Luison
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.
Originally posted by: Adrian Wheat
I don't have a C++ compiler, nor would I know what to do even if I did! Does anyone have the compiled dll that they could email me? It would be most appreciated. Thanks!
Reply