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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MAPI - IAddrBook,calling to function Address(..) to open address book fails

MAPI - IAddrBook,calling to function Address(..) to open address book fails

Scheduled Pinned Locked Moved C / C++ / MFC
helpcomquestionlearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    YaronNir
    wrote on last edited by
    #1

    Hi all, this is the code i am using to open the address book (using MAPI)

    USES_CONVERSION;

    LPADRLIST lpadrlist = NULL;
    LPTSTR rglpszDestTitles[1];
    ULONG rgulDestComps[1];
    ULONG ulUIParam = 0;
    rglpszDestTitles[0] = (LPWSTR) T2A(_T("To"));
    rgulDestComps[0] = MAPI_TO;
    ADRPARM adrparm;
    adrparm.cbABContEntryID = 0;
    adrparm.lpABContEntryID = NULL;
    adrparm.ulFlags = (DIALOG_MODAL | AB_SELECTONLY | AB_RESOLVE);
    adrparm.lpReserved = NULL;
    adrparm.ulHelpContext = 0;
    adrparm.lpszHelpFileName = NULL;
    adrparm.lpfnABSDI = NULL;
    adrparm.lpfnDismiss = NULL;
    adrparm.lpvDismissContext = NULL;
    adrparm.lpszCaption = (LPWSTR) T2A(_T("Select Outlook contacts"));
    adrparm.lpszNewEntryTitle = (LPWSTR) T2A(_T("For this dialog"));
    adrparm.lpszDestWellsTitle = (LPWSTR) T2A(_T("Selected Recipients:"));
    adrparm.cDestFields = 1;
    adrparm.nDestFieldFocus = 0;
    adrparm.lppszDestTitles = rglpszDestTitles;
    adrparm.lpulDestComps = rgulDestComps;
    adrparm.lpContRestriction = NULL;
    adrparm.lpHierRestriction = NULL;
    HRESULT hr = (pAdrBook->Address( &ulUIParam, &adrparm, &lpadrlist));

    the address book opens ok, but sometimes, it failed and the hresult is 0x8007000E.... haven't seen any documentation on this error, or what it means.... can any1 help? thanks Yaron

    Interface basics click here : http://www.codeproject.com/com/COMBasics.asp don't forget to vote :)

    P 1 Reply Last reply
    0
    • Y YaronNir

      Hi all, this is the code i am using to open the address book (using MAPI)

      USES_CONVERSION;

      LPADRLIST lpadrlist = NULL;
      LPTSTR rglpszDestTitles[1];
      ULONG rgulDestComps[1];
      ULONG ulUIParam = 0;
      rglpszDestTitles[0] = (LPWSTR) T2A(_T("To"));
      rgulDestComps[0] = MAPI_TO;
      ADRPARM adrparm;
      adrparm.cbABContEntryID = 0;
      adrparm.lpABContEntryID = NULL;
      adrparm.ulFlags = (DIALOG_MODAL | AB_SELECTONLY | AB_RESOLVE);
      adrparm.lpReserved = NULL;
      adrparm.ulHelpContext = 0;
      adrparm.lpszHelpFileName = NULL;
      adrparm.lpfnABSDI = NULL;
      adrparm.lpfnDismiss = NULL;
      adrparm.lpvDismissContext = NULL;
      adrparm.lpszCaption = (LPWSTR) T2A(_T("Select Outlook contacts"));
      adrparm.lpszNewEntryTitle = (LPWSTR) T2A(_T("For this dialog"));
      adrparm.lpszDestWellsTitle = (LPWSTR) T2A(_T("Selected Recipients:"));
      adrparm.cDestFields = 1;
      adrparm.nDestFieldFocus = 0;
      adrparm.lppszDestTitles = rglpszDestTitles;
      adrparm.lpulDestComps = rgulDestComps;
      adrparm.lpContRestriction = NULL;
      adrparm.lpHierRestriction = NULL;
      HRESULT hr = (pAdrBook->Address( &ulUIParam, &adrparm, &lpadrlist));

      the address book opens ok, but sometimes, it failed and the hresult is 0x8007000E.... haven't seen any documentation on this error, or what it means.... can any1 help? thanks Yaron

      Interface basics click here : http://www.codeproject.com/com/COMBasics.asp don't forget to vote :)

      P Offline
      P Offline
      PJ Arends
      wrote on last edited by
      #2

      YaronNir wrote:

      it failed and the hresult is 0x8007000E

      If you use the "Error Lookup" tool that comes with VS (Usually listed under the 'Tools' menu) you can find out what the error code means. For 0x8007000E it returns "Not enough storage is available to complete this operation."


      You may be right
      I may be crazy
      -- Billy Joel --

      Within you lies the power for good, use it!!!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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