CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2001
    Posts
    89

    MAPI and openning the address book

    Help...
    I managed to make a VC++ application which can open my outlook address book. Yet, it fails to work when the default mail programm is not outlook..
    the failure is at :

    if ( FAILED(hResult = MAPIInitialize(NULL)))

    how can i solve this?

    Any help will be HIGHLY appreciated


  2. #2
    Join Date
    Aug 1999
    Location
    Canada
    Posts
    2,076

    Re: MAPI and openning the address book

    What is the hResult error code?

    I use in my program MAPI initialization like in the piece of code bellow. Is better to use pointers to function and get address using GetProcAddress()to avoid conflicts with old MAPI DLLs( some function are not exported). And it works for me. Doesn't matter if OUTLOOK is or isn't default E-mail client.

    But I don't know if this is your real problem.


    typedef ULONG (FAR PASCAL * PFNMAPIINITIALIZE)( LPVOID );

    PFNMAPIINITIALIZE lpfnMAPIInitialize;
    HMODULE hLibrary = LoadLibrary( "MAPI32.DLL" )
    lpfnMAPIInitialize = (PFNMAPIINITIALIZE)GetProcAddress( hLibrary, "MAPIInitialize" );

    HRESULT hr = lpfnMAPIInitialize( NULL );






  3. #3
    Join Date
    Mar 2001
    Posts
    89

    Re: MAPI and openning the address book

    Hi
    I thank you for your answear.. yet..I got the same result..
    the hResult error code is 0x80004005 = Unspecified error ...
    what can cause it.....?




  4. #4
    Join Date
    Aug 1999
    Location
    Canada
    Posts
    2,076

    Re: MAPI and openning the address book

    Unspecified error(E-FAIL) means NOTHING.

    Take a look to Task Manager if Mapisp32(MAPI spooler) process is running on your machine? Otherwise you can't open MAPI session. And take a look to MSDN for Mapisp32.

    Maybe there is the problem after setting up OUTLOOK as non default E-mail client.

    Good luck




  5. #5
    Join Date
    Jan 2001
    Posts
    73

    Re: MAPI and openning the address book

    are you able now to open the address book and export the contact in it ? if yes...i,d like have a clue of how to do it

    thanks1

    VincE


  6. #6
    Join Date
    Sep 1999
    Location
    Utah [Zion]
    Posts
    667

    Re: MAPI and openning the address book


  7. #7
    Join Date
    Mar 2001
    Posts
    89

    Re: MAPI and openning the address book

    Send me your e-mail and i will be happy to help


  8. #8
    Join Date
    Mar 2001
    Posts
    89

    Re: MAPI and openning the address book

    I found that if i installed explorer my system directory consists of MAPI32.dll , yet,if I install Eudora or netscape,during the installation MAPI32.dl is being renamed !
    Ill look into it some more
    Thank u 4 your help


  9. #9
    Join Date
    Jan 2001
    Posts
    73

    Re: MAPI and openning the address book

    my email is

    vhuard@qc.aira.com

    thanks!


  10. #10
    Join Date
    Jan 2001
    Posts
    73

    Re: MAPI and openning the address book

    thanks for the code!

    does Outlook must be the default mail client ??




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured