Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

vinvino2001

@vinvino2001
About
Posts
5
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • MAPI: MapiRecipDesc is not properly working with Lotus Notes (ver8.5) [modified]
    V vinvino2001

    Can any one help on this? Regards, Vinoth

    ATL / WTL / STL help c++ delphi com debugging

  • MAPI: MapiRecipDesc is not properly working with Lotus Notes (ver8.5) [modified]
    V vinvino2001

    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, &note, MAPI\_DIALOG, 0L );
    
    }
    
    return nRetCode;
    

    }

    Regards, Vinoth

    modified on

    ATL / WTL / STL help c++ delphi com debugging

  • TAB and Escape keys are not working in windows created using CreateDialog
    V vinvino2001

    Hi, 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

    C / C++ / MFC c++ help

  • Need help to get list of files in a directory...
    V vinvino2001

    You have to recursively call and iterate each Folders from the output if findFileData.dwFileAttributes is FILE_ATTRIBUTE_DIRECTORY. Try that.

    C / C++ / MFC help c++

  • Need help to get list of files in a directory...
    V vinvino2001

    Directly take the output from findFileData.cFileName. The problem exists in your convertWCharArrayToString().

    std::cout <<fileNumber <<":" <<findFileData.cFileName <<std::endl;

    C / C++ / MFC help c++
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups