I have a little question: If i drag&drop a mail with attachment and "save it", i get an error in the "Outlook drop target demo" : Project OutlookDemo.exe raised exception class EOleSysError with message "access denied ". process stopped….
Mails with no attachments are working fine.
Office Outlook 2003(11.8217.8221) SP3
Borland Delphi Enterprise Version 7.0
Windows XP SP3
Instead of trying to construct a MSG file from the IMessage interface, which apparently is a really complex and fragile task even though it should be simple, I now keep a reference to the original IStorage interface and save that instead.
I will release the updated demo once I have tidied up the modified source, but I'm out of time for today.
Hi!
I tried your demos virtualfilestream and virtualfile with outlook attachment but it only works with .txt files. I tried it with pdf and the program catch the name of the file but not all of the content.
If a drag the file from your program to the desktop, the program creates the file but I can't open it. It gives me an error, and say that can't repair the file.
¿Do you know what the problem is?
The VirtualFile demo, by design, limits the amount of data to 32K. This is documented in the source:
// Limit the amount of data to 32Kb. If someone drops a huge amount on data on// us (e.g. the AsyncTransferSource demo which transfers 10Mb of data) we need// to limit how much data we try to stuff into the poor memo field. Otherwise// we could wait for hours before transfer was finished.
MemoContents.Lines.Text := Copy(FTargetDataFormat.Contents, 1, 1024*32);
The VirtualFileStream demo, again by design, limits the amount of data it saves to 1K. This isn't explicitly documented in the source, but the source comments does hint that for a real application you will need to implement your own storage of the data:
// In a real-world application we would write the buffer to disk// now. E.g.:// FileStream.WriteBuffer(p^, BufferSize-Chunk);
If you set a break-point in the OnDrop event handlers it should be pretty clear what is going on with the data.
I will try to work a little on the VirtualFileStream example to make it more obvious what one has to do.
vt: Hello, please tell me how to hide drag image (if property ShowImage := True) in OnDrop event? Sometimes program...
Gregory: Hi Anders, Please, we need new version for XE2 :) Many tanks for your work ! You are great ! Thanks.
Simon H.: Hi Anders, Do you plan on making a version for XE2 ? Currently, the package returns quite a few errors when...
Dont bother...
...writing comments. I don't have time or motivation to moderate comments or answer questions and my wordpress is so broken that I can't even turn the comment option off.
If you need help, please try stackoverflow.
Sorry.
YAY!
Very well done, sir!
Fantastic — thank you so much for sharing this with all of us.
-mouser
thank you! very good component!
Nice, but why is
TDropFileTarget.Files
declared asTUnicodeStrings
instead ofTFileStrings
from same unit? This is problem for nonunicode delphi.The
Files
properties are declared asTUnicodeStrings
in order to support Unicode file names on all versions of Delphi.This should not be a problem for older versions of Delphi (i.e. pre-D2009) as they will implicitly convert the Unicode strings to Ansi as needed.
E.g. this works just fine:
Thank you. This is realy a great component.
I have a little question: If i drag&drop a mail with attachment and "save it", i get an error in the "Outlook drop target demo" : Project OutlookDemo.exe raised exception class EOleSysError with message "access denied ". process stopped….
Mails with no attachments are working fine.
Office Outlook 2003(11.8217.8221) SP3
Borland Delphi Enterprise Version 7.0
Windows XP SP3
Thanx for your great work.
best regards
Erich
I have reproduced the problem and am investigating the cause.
Thanks for the feedback.
I have found a solution to this problem.
Instead of trying to construct a MSG file from the
IMessage
interface, which apparently is a really complex and fragile task even though it should be simple, I now keep a reference to the originalIStorage
interface and save that instead.I will release the updated demo once I have tidied up the modified source, but I'm out of time for today.
Thanks Anders. I find this one of the most valuable component suites for Delphi. Really happy to see it's still begin maintained
Hi!
I tried your demos virtualfilestream and virtualfile with outlook attachment but it only works with .txt files. I tried it with pdf and the program catch the name of the file but not all of the content.
If a drag the file from your program to the desktop, the program creates the file but I can't open it. It gives me an error, and say that can't repair the file.
¿Do you know what the problem is?
The VirtualFile demo, by design, limits the amount of data to 32K. This is documented in the source:
The VirtualFileStream demo, again by design, limits the amount of data it saves to 1K. This isn't explicitly documented in the source, but the source comments does hint that for a real application you will need to implement your own storage of the data:
If you set a break-point in the OnDrop event handlers it should be pretty clear what is going on with the data.
I will try to work a little on the VirtualFileStream example to make it more obvious what one has to do.
Thank you! Finally I can save the entire drop file saving the
FTargetDataFormat.Contents
directly, and I commentedClearData
..etc.