Click here to Skip to main content
15,893,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to tell whether explorer is hiding extensions for known file types ?. Pin
Atom9-May-06 11:09
Atom9-May-06 11:09 
GeneralRe: How to tell whether explorer is hiding extensions for known file types ?. Pin
David Crow10-May-06 3:13
David Crow10-May-06 3:13 
GeneralRe: How to tell whether explorer is hiding extensions for known file types ?. Pin
Atom10-May-06 6:33
Atom10-May-06 6:33 
QuestionProgramming Chip Cards Pin
branebb9-May-06 7:58
branebb9-May-06 7:58 
Questionget the coordinates of a pixel Pin
baile799-May-06 7:26
baile799-May-06 7:26 
AnswerRe: get the coordinates of a pixel Pin
David Crow9-May-06 7:42
David Crow9-May-06 7:42 
QuestionSOLVED! info in char variable changes to weird characters Pin
ilion blaze9-May-06 6:37
ilion blaze9-May-06 6:37 
QuestionMAPI application problem Pin
msolh9-May-06 6:08
msolh9-May-06 6:08 
I was trying to retrieve the body of a message using the code below but
It is always returning
MAPI-E-NOT-FOUND:

hr = m_pfldrInbox->OpenEntry(
m_pInbox[msgID].lpProps[0].Value.bin.cb,
(ENTRYID*)m_pInbox[msgID].lpProps[0].Value.bin.lpb,
NULL,
MAPI_MODIFY | MAPI_DEFERRED_ERRORS,
&ulObjType,
(LPUNKNOWN*)&lpMessage);
//MessageBox(0, L"Message Opened", L"", 0);
if (SUCCEEDED(hr))
{
SPropValue * rgMsgprops = NULL;
ULONG rgMsgTags[] = {1, PR_BODY};
ULONG cCount = 0;
// IStream* istream;
ULONG ulNumChars;
// hr = lpMessage->GetProps((LPSPropTagArray) rgMsgTags, MAPI_UNICODE,
&cCount, &rgMsgprops);


hr = HrGetOneProp(lpMessage,PR_BODY,&rgMsgprops);
if (hr == MAPI_E_NOT_ENOUGH_MEMORY)
{
MessageBox(0, L"Not enough memory", L"", 0);
hr = lpMessage->OpenProperty(
PR_BODY,
&IID_IStream,
STGM_READ,
NULL,
(LPUNKNOWN *) &lpStream);


do
{
lpStream->Read(
sBuffer,
255,
&ulNumChars);
// if (ulNumChars >0) printf("%.*s",ulNumChars,szBuf);
}
while (ulNumChars >= 255);


// printf("\n");


hr = S_OK;
}


else if (hr == MAPI_E_NOT_FOUND)
{
//This is not an error. Many messages do not have
bodies.
//printf("Message has no body!\n");
MessageBox(0, L"Message has no body", L"", 0);
hr = S_OK;
}
else
{


//MessageBox(0, "%d", rgMsgprops[0].Value.lpszA, 0);
int x = 0;
do
{
sBuffer[x] = rgMsgprops[0].Value.lpszW[x];
x++;
//MessageBox(0, (LPCWSTR)sBuffer, L"", 0);
//bufferlen = strlen(rgMsgprops[0].Value.lpszW);
}while (((int)rgMsgprops[0].Value.lpszW[x-1] != NULL) && (x <
255));
}
}


If you can tell what is the problem please help

-- modified at 13:58 Tuesday 9th May, 2006
QuestionRe: MAPI application problem Pin
David Crow9-May-06 6:09
David Crow9-May-06 6:09 
AnswerRe: MAPI application problem Pin
msolh9-May-06 6:15
msolh9-May-06 6:15 
GeneralRe: MAPI application problem Pin
David Crow9-May-06 7:36
David Crow9-May-06 7:36 
GeneralRe: MAPI application problem Pin
msolh9-May-06 7:54
msolh9-May-06 7:54 
QuestionRe: MAPI application problem Pin
David Crow10-May-06 3:16
David Crow10-May-06 3:16 
AnswerRe: MAPI application problem Pin
msolh10-May-06 3:37
msolh10-May-06 3:37 
QuestionCreating Help for vc++ application Pin
sudeep_br9-May-06 5:29
sudeep_br9-May-06 5:29 
AnswerRe: Creating Help for vc++ application Pin
bob169729-May-06 6:02
bob169729-May-06 6:02 
AnswerRe: Creating Help for vc++ application Pin
David Crow9-May-06 6:11
David Crow9-May-06 6:11 
GeneralRe: Creating Help for vc++ application Pin
toxcct9-May-06 6:17
toxcct9-May-06 6:17 
GeneralRe: Creating Help for vc++ application Pin
David Crow9-May-06 7:44
David Crow9-May-06 7:44 
GeneralRe: Creating Help for vc++ application Pin
normanS9-May-06 19:31
normanS9-May-06 19:31 
GeneralRe: Creating Help for vc++ application Pin
sudeep_br12-May-06 19:48
sudeep_br12-May-06 19:48 
GeneralRe: Creating Help for vc++ application Pin
normanS14-May-06 20:12
normanS14-May-06 20:12 
GeneralRe: Creating Help for vc++ application Pin
sudeep_br14-May-06 23:58
sudeep_br14-May-06 23:58 
GeneralRe: Creating Help for vc++ application Pin
normanS15-May-06 2:23
normanS15-May-06 2:23 
GeneralRe: Creating Help for vc++ application Pin
sudeep_br15-May-06 4:56
sudeep_br15-May-06 4:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.