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 in NT Service - PLEASE HELP??

MAPI in NT Service - PLEASE HELP??

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
4 Posts 3 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.
  • D Offline
    D Offline
    Dan Madden
    wrote on last edited by
    #1

    Hi and thanks for your time! I am working on a project and can not get MAPI to work in my NT Service (W2K) :( . I have the service logging in as "LocalSystem" (have also tried my Domain account but nothing happens) and there is no dependencies. The same code (minus some NT Service stuff) works in a normal MFC Exe. Here is the code: ... ... ... LPMAPISESSION lpSession; pMapiInit.ulVersion = MAPI_INIT_VERSION; pMapiInit.ulFlags = MAPI_NT_SERVICE; FLAGS flFlag = MAPI_NO_MAIL | MAPI_NEW_SESSION | MAPI_NT_SERVICE; hr = MAPIInitialize(&pMapiInit); if (!HR_SUCCEEDED(hr)) { MessageBox (NULL, "MAPIInitialize failed.", "", MB_OK); goto cleanup; } hr = MAPILogonEx(0L, (LPTSTR)"dmadden", (LPTSTR)NULL, flFlag, &lpSession); if (HR_SUCCEEDED(hr)) { // I never get here!!!!! :confused: } ... ... ... I would really appreciate help!! Thanks in advance, Dan :cool:

    L 1 Reply Last reply
    0
    • D Dan Madden

      Hi and thanks for your time! I am working on a project and can not get MAPI to work in my NT Service (W2K) :( . I have the service logging in as "LocalSystem" (have also tried my Domain account but nothing happens) and there is no dependencies. The same code (minus some NT Service stuff) works in a normal MFC Exe. Here is the code: ... ... ... LPMAPISESSION lpSession; pMapiInit.ulVersion = MAPI_INIT_VERSION; pMapiInit.ulFlags = MAPI_NT_SERVICE; FLAGS flFlag = MAPI_NO_MAIL | MAPI_NEW_SESSION | MAPI_NT_SERVICE; hr = MAPIInitialize(&pMapiInit); if (!HR_SUCCEEDED(hr)) { MessageBox (NULL, "MAPIInitialize failed.", "", MB_OK); goto cleanup; } hr = MAPILogonEx(0L, (LPTSTR)"dmadden", (LPTSTR)NULL, flFlag, &lpSession); if (HR_SUCCEEDED(hr)) { // I never get here!!!!! :confused: } ... ... ... I would really appreciate help!! Thanks in advance, Dan :cool:

      L Offline
      L Offline
      l a u r e n
      wrote on last edited by
      #2

      is "dmadden" the local system account? mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them

      D 1 Reply Last reply
      0
      • L l a u r e n

        is "dmadden" the local system account? mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them

        D Offline
        D Offline
        Dan Madden
        wrote on last edited by
        #3

        Thanks for taking the time to respond! I'm new at this Services game...dmadden is my domain account. Could you tell me what I need to do to get this reading the right one (if this is incorrect...remember it doesn't work even if I set it up to use my Domain account)? The Service needs to connect to a Domain account when it starts. The Server will (of course) also be in the Domain (not to mention the Server where the mailbox resides). Thanks in advance, Dan

        L 1 Reply Last reply
        0
        • D Dan Madden

          Thanks for taking the time to respond! I'm new at this Services game...dmadden is my domain account. Could you tell me what I need to do to get this reading the right one (if this is incorrect...remember it doesn't work even if I set it up to use my Domain account)? The Service needs to connect to a Domain account when it starts. The Server will (of course) also be in the Domain (not to mention the Server where the mailbox resides). Thanks in advance, Dan

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Daniel two questions: (1) Which account are you installing this app into the SCM?? (2) Have you tried specifying your FULL domain name for the account name?? (ie. instead of "dmadden" have you tried "\dmadden"??

          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