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