Can any one help on this? Regards, Vinoth
vinvino2001
Posts
-
MAPI: MapiRecipDesc is not properly working with Lotus Notes (ver8.5) [modified] -
MAPI: MapiRecipDesc is not properly working with Lotus Notes (ver8.5) [modified]Hi, I need to send a mail to a particular email address from the application. For this purpose, I am using MAPI APIs. Following is the code which is used in the application. This code is working properly with MS Outlook Express; however, in Lotus Notes, email ID specified in the code is not added to the "To" field of email. Other values given in the MapiRecipDesc structure is added to the email properly. Can any one help to solve the issue?
// Mail Application.cpp : Defines the entry point for the console application.
//#include "stdafx.h"
#include "Mail Application.h"
#include <MAPI.h>#ifdef _DEBUG
#define new DEBUG_NEW
#endif// The one and only application object
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;// initialize MFC and print and error on failure if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) { // TODO: change error code to suit your needs \_tprintf(\_T("Fatal Error: MFC initialization failed\\n")); nRetCode = 1; } else { MapiRecipDesc sender; MapiRecipDesc recipient; MapiMessage note; HMODULE hinstMapi32Dll = NULL; if (hinstMapi32Dll == NULL) hinstMapi32Dll = ::LoadLibraryA("MAPI32.DLL"); if (hinstMapi32Dll == NULL) { AfxMessageBox(AFX\_IDP\_FAILED\_MAPI\_LOAD); return -1; } ULONG (PASCAL \*lpfnMAPISendMail)(ULONG, ULONG, MapiMessage\*, FLAGS, ULONG); lpfnMAPISendMail = (LPMAPISENDMAIL)GetProcAddress( hinstMapi32Dll, "MAPISendMail"); sender.ulReserved = 0; sender.ulRecipClass = MAPI\_ORIG; sender.lpszName = "My Name"; sender.lpszAddress = "me@myeamil.com"; sender.ulEIDSize = 0; sender.lpEntryID = NULL; recipient.ulReserved = 0; recipient.ulRecipClass = MAPI\_TO; recipient.lpszName = "Person Name"; recipient.lpszAddress = "SMTP:towhomitmayconcern@email.com"; recipient.ulEIDSize = 0; recipient.lpEntryID = NULL; note.ulReserved = 0; note.lpszSubject = "Subject goes here"; note.lpszNoteText = "Message body goes here"; note.lpszMessageType = NULL; note.lpszDateReceived = NULL; note.lpszConversationID = NULL; note.flFlags = 0L; note.lpOriginator = &sender; note.nRecipCount = 1; note.lpRecips = &recipient; note.nFileCount = 0; note.lpFiles = NULL; nRetCode = lpfnMAPISendMail( 0, 0L, ¬e, MAPI\_DIALOG, 0L ); } return nRetCode;
}
Regards, Vinoth
modified on
-
TAB and Escape keys are not working in windows created using CreateDialogHi, I have created modeless dialogs in MFC using CreateDialog() and dialog is successfully shown.
void ParentDialog::OnButton1()
{
// TODO: Add your control notification handler code here
HWND retcode = CreateDialogParam(NULL,
MAKEINTRESOURCE(IDD_DIALOG2),
NULL,
MainWndProc);
}In message handler, added the following
int APIENTRY MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{switch(uMsg) { case WM\_INITDIALOG: ShowWindow(hwnd, SW\_SHOW); UpdateWindow(hwnd); return TRUE; break; case WM\_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { DestroyWindow(hwnd); return TRUE; } break; } return FALSE;
}
After dialogs are displayed, when I am pressing hot keys or escape from the child dialogs, it is not working. Please help me. Thanks in advance. Vinoth
-
Need help to get list of files in a directory...You have to recursively call and iterate each Folders from the output if findFileData.dwFileAttributes is FILE_ATTRIBUTE_DIRECTORY. Try that.
-
Need help to get list of files in a directory...Directly take the output from findFileData.cFileName. The problem exists in your convertWCharArrayToString().
std::cout <<fileNumber <<":" <<findFileData.cFileName <<std::endl;