res = lpMAPISendMail(NULL, (ULONG)GetDesktopWindow(), &Msg,
MAPI_LOGON_UI|MAPI_DIALOG, 0);
fprintf(fp, "Message sending AFTER\n");
if (res == MAPI_E_AMBIGUOUS_RECIPIENT )
fprintf(fp, "Error Code: MAPI_E_AMBIGUOUS_RECIPIENT");
else if (res == MAPI_E_ATTACHMENT_NOT_FOUND )
fprintf(fp, "Error Code: MAPI_E_ATTACHMENT_NOT_FOUND");
else if (res == MAPI_E_ATTACHMENT_OPEN_FAILURE )
fprintf(fp, "Error Code: MAPI_E_ATTACHMENT_OPEN_FAILURE");
else if (res == MAPI_E_BAD_RECIPTYPE )
fprintf(fp, "Error Code: MAPI_E_BAD_RECIPTYPE");
else if (res == MAPI_E_FAILURE )
fprintf(fp, "Error Code: MAPI_E_FAILURE");
else if (res == MAPI_E_INSUFFICIENT_MEMORY )
fprintf(fp, "Error Code: MAPI_E_INSUFFICIENT_MEMORY");
else if (res == MAPI_E_INVALID_RECIPS )
fprintf(fp, "Error Code: MAPI_E_INVALID_RECIPS");
else if (res == MAPI_E_LOGIN_FAILURE )
fprintf(fp, "Error Code: MAPI_E_LOGIN_FAILURE");
else if (res == MAPI_E_TEXT_TOO_LARGE )
fprintf(fp, "Error Code: MAPI_E_TEXT_TOO_LARGE");
else if (res == MAPI_E_TOO_MANY_FILES )
fprintf(fp, "Error Code: MAPI_E_TOO_MANY_FILES");
else if (res == MAPI_E_TOO_MANY_RECIPIENTS )
fprintf(fp, "Error Code: MAPI_E_TOO_MANY_RECIPIENTS");
else if (res == MAPI_E_UNKNOWN_RECIPIENT )
fprintf(fp, "Error Code: MAPI_E_UNKNOWN_RECIPIENT");
else if (res == MAPI_E_USER_ABORT )
fprintf(fp, "Error Code: MAPI_E_USER_ABORT");
else
fprintf(fp, "Result = %ul", res);
and that (I think) comes out as MAPI_E_NOT_SUPPORTED (I'm not sure
whether the value maps like that, but I think I'm right). If this is
the case, why should this problem be occurring? It only happens the
1st time, immediately after install; the rest of the times it works
perfectly.
Lastly, the same code works perfectly well when we start the app. the
2nd time. And this time also we pass the same set of parameters.
Thanks in advance,
regards,
--Jaffar