|
From: mihamih on 24 Jun 2008 12:06 Hi, I'm trying to read e-mail attachments by following instructions at: http://msdn.microsoft.com/enus/library/ms838293.aspx#ppc_2002part3_topic3 I get attachment size from PR_ATTACH_SIZE properly. When I call OpenAttach it succeeds and gives me an IStream pointer. But stream size is 0 and if I try to read I just get success with 0 bytes every time I read. I also tried different things like getting PR_ATTACH_METHOD but this does not appear to be set. I try to open the stream as follows: hr = pAttachment->OpenProperty(PR_ATTACH_DATA_BIN, &IID_IStream, STGM_READ, 0, (IUnknown**)&pStream); Does anyone have an example or how to read e-mail attachments or know what the catch is? I also need to get attachment mime type but none of the PR_ATTACH_MIME_TYPE properties seem to be set. I'm working on WM 5.0 with C++ Thanks much! Mihaela
From: Peter Foot on 25 Jun 2008 02:45 According to the documentation the second and third arguments should not be used on Windows CE e.g. hr = pAttachment->OpenProperty(PR_ATTACH_DATA_BIN, NULL, NULL, 0, (IUnknown**)&pStream); The stream returned from this function does not support length, you have to just keep reading until there is no more data. Peter -- Peter Foot Microsoft Device Application Development MVP peterfoot.net | appamundi.com | inthehand.com APPA Mundi Ltd - Software Solutions for a Mobile World In The Hand Ltd - .NET Components for Mobility "mihamih" <abc(a)abc.com> wrote in message news:OaTpERh1IHA.4704(a)TK2MSFTNGP05.phx.gbl... > Hi, > > I'm trying to read e-mail attachments by following instructions at: > http://msdn.microsoft.com/enus/library/ms838293.aspx#ppc_2002part3_topic3 > > I get attachment size from PR_ATTACH_SIZE properly. When I call OpenAttach > it succeeds and gives me an IStream pointer. But stream size is 0 and if I > try to read I just get success with 0 bytes every time I read. > > I also tried different things like getting PR_ATTACH_METHOD but this does > not appear to be set. > > I try to open the stream as follows: > hr = pAttachment->OpenProperty(PR_ATTACH_DATA_BIN, &IID_IStream, > STGM_READ, 0, (IUnknown**)&pStream); > > Does anyone have an example or how to read e-mail attachments or know what > the catch is? > > I also need to get attachment mime type but none of the > PR_ATTACH_MIME_TYPE properties seem to be set. > > I'm working on WM 5.0 with C++ > > Thanks much! > Mihaela > > >
From: mihamih on 25 Jun 2008 08:59 ok thanks. Also the attachment was not downloaded so I had to download it (kind of obvious but I missed that at first). Mihaela "Peter Foot" <feedback(a)nospam-inthehand.com> wrote in message news:F3FF210E-42B2-4E79-B717-F21FE7F1B15D(a)microsoft.com... > According to the documentation the second and third arguments should not > be used on Windows CE e.g. > hr = pAttachment->OpenProperty(PR_ATTACH_DATA_BIN, NULL, NULL, 0, > (IUnknown**)&pStream); > > The stream returned from this function does not support length, you have > to just keep reading until there is no more data. > > Peter > > -- > Peter Foot > Microsoft Device Application Development MVP > peterfoot.net | appamundi.com | inthehand.com > APPA Mundi Ltd - Software Solutions for a Mobile World > In The Hand Ltd - .NET Components for Mobility > > > "mihamih" <abc(a)abc.com> wrote in message > news:OaTpERh1IHA.4704(a)TK2MSFTNGP05.phx.gbl... >> Hi, >> >> I'm trying to read e-mail attachments by following instructions at: >> http://msdn.microsoft.com/enus/library/ms838293.aspx#ppc_2002part3_topic3 >> >> I get attachment size from PR_ATTACH_SIZE properly. When I call >> OpenAttach it succeeds and gives me an IStream pointer. But stream size >> is 0 and if I try to read I just get success with 0 bytes every time I >> read. >> >> I also tried different things like getting PR_ATTACH_METHOD but this does >> not appear to be set. >> >> I try to open the stream as follows: >> hr = pAttachment->OpenProperty(PR_ATTACH_DATA_BIN, &IID_IStream, >> STGM_READ, 0, (IUnknown**)&pStream); >> >> Does anyone have an example or how to read e-mail attachments or know >> what the catch is? >> >> I also need to get attachment mime type but none of the >> PR_ATTACH_MIME_TYPE properties seem to be set. >> >> I'm working on WM 5.0 with C++ >> >> Thanks much! >> Mihaela >> >> >> >
|
Pages: 1 Prev: How to view HTML page in Pocket PC emulator Next: Sleep() time doubled when using emulator |