Quantcast
Channel: MFCMAPI
Viewing all 1090 articles
Browse latest View live

New Post: Outlook 2007 does not terminate after the MapiLogonEx

$
0
0
Thank you for your quick response. I will try the same and update you.

New Post: Error : Cannot open your default e-mail folders. the file ..outlook.pst is in use and cannot be accessed.

$
0
0
Hi,

I have written a multithreaded console application, which fetches all contacts. Sometimes(on some machines) when this MAPI application is running, and I open the outlook, I get the following message in the Outlook.
Cannot open your default e-mail folders. the file ..outlook.pst is in use and cannot be accessed.

Following is the code snippet
//Mapiinitialize with MAPI_MULTITHREAD_NOTIFICATIONS
MAPIInitialize();

// Login
MAPILogonEx(0,
    (LPTSTR)csProfileName.c_str(),
    (LPTSTR)csProfilePassword.c_str(),
    MAPI_EXTENDED | MAPI_NO_MAIL | MAPI_NEW_SESSION | MAPI_USE_DEFAULT,
    &m_lpMAPISession);

//Open the default message store        
m_lpMAPISession->OpenMsgStore(0,                                                            //Window handle for dialogs
            sRows->aRow[0].lpProps[ePR_ENTRYID].Value.bin.cb,               //size and...
            (LPENTRYID)sRows->aRow[0].lpProps[ePR_ENTRYID].Value.bin.lpb,   //value of entry to open
            NULL,                                                       //Use default interface (IMsgStore) to open store
            MDB_NO_MAIL|MDB_NO_DIALOG,                                          //Flags
            &m_lpMsgStore);                                         //Pointer to place the store in

//Open Inbox
m_lpMsgStore->GetReceiveFolder( NULL,      //Get default receive folder
            0,      //Flags
            &cbInbox,  //Size and ...
            &lpbInbox, //Value of the EntryID to be returned
            NULL);     //You don't care to see the class returned

m_lpMsgStore->OpenEntry(    cbInbox,                      //Size and...
            lpbInbox,                     //Value of the Inbox's EntryID
            NULL,                         //We want the default interface    (IMAPIFolder)
            0,                            //Flags
            &ulObjType,                   //Object returned type
            (LPUNKNOWN *) &m_lpInboxFolder); //Returned folder      

//Get Contacts
m_lpMsgStore->OpenEntry(    cb,
            lpContactEid,
            NULL,           //default interface
            0,
            &ulObjType,
            (LPUNKNOWN *) &lpFolder);

//read all contacts
lpFolder->GetContentsTable(0, &lpContentsTable);

Sleep(1000000);

UlRelease(m_lpMsgStore);
Release all other objects

MapiLogOff()

MapiUninitalize()
Note: I have also implemented the message loop(i.e using HRDispatchNotifications in the main tread which calls MapiInitialize.

Any help is appreciated.

Would it happen because I keep the MessageStore Open for long?? Or should I use some specific flags with OpenMsgStore.

Regards,
Rohan

New Post: Error : Cannot open your default e-mail folders. the file ..outlook.pst is in use and cannot be accessed.

New Post: Error : Cannot open your default e-mail folders. the file ..outlook.pst is in use and cannot be accessed.

$
0
0
I am calling IMAPISession::Logoff().

I did following minor code change which seemed to have solved this issue.
  • Earlier I used to release the m_lpMsgStore just before the application termination, instead I changed this implementation so that I release m_lpMsgStore at the earliest[i.e in the above case I called UlRelease(m_lpMsgStore) immediately after m_lpMsgStore->OpenEntry]
Can you please let me know in which scenarios Outlook displays the message "Cannot open your default e-mail folders. the file ..outlook.pst is in use and cannot be accessed. ".? I guess you might have access to the Outlook code.

New Post: Problems with opening new sessions in MCFMAPI Feb 2014 release

$
0
0
When in MFCMAPI I set SESSION -> OPEN SESSION It will display the Profile window. But if I try to create a new profile, it does always open my own personal mailbox and does not let me to change the profile configurations. I can set lot of new display names, but they points always to my own account.

How to get "next step", meaning the possibility to change profile configurations when opening the session with MFCMAPI Feb14 release?

Thanks in advance!

New Post: Problems with opening new sessions in MCFMAPI Feb 2014 release

$
0
0
What steps are you following to create a new profile?

New Post: Problems with opening new sessions in MCFMAPI Feb 2014 release

$
0
0

Open MFCMAPI tool, From main view select SESSION From upper menu, LOG ON.

It will prompt the Outlook profile window, you will set a display name. After OK it should come a new window where you can configurate the profile. But mine just closes and my own mailbox opens.

New Post: Problems with opening new sessions in MCFMAPI Feb 2014 release

$
0
0
When the profile dialog comes up, are you hitting the "New" button? It sounds like you're just picking an existing profile.

New Post: Problems with opening new sessions in MCFMAPI Feb 2014 release

$
0
0

Open MFCMAPI tool -> Select SESSION from menu -> select LOGON -> From Choose profile select NEW PROFILE button write new displayname and press ok.

After the final step should come a window where to define servers and user names etc. But in my case I can just see a MFCMapi session being opened immediately to my own mailbox.

New Post: Problems with opening new sessions in MCFMAPI Feb 2014 release

$
0
0
I have never seen the profile picker function as you describe. What version of Outlook are you running? Perhaps some screenshots would help illustrate what you're seeing?

Source code checked in, #108041

$
0
0
Problem: Add feature to add attachments to a message Fix: Done

New Post: How to get the EMail Address from a contact

$
0
0
Hi,
I have written a Mapi application which would read couple of properties from a give contact. Most of the properties like PR_HOME_TELEPHONE_NUMBER , PR_HOME2_TELEPHONE_NUMBER , PR_MOBILE_TELEPHONE_NUMBER are working fine.

However, I could not get any property for getting the mailid(e.g. PR_EMAIL_ADDRESS). But after checking in couple of machine, I found that email address is getting stored in following tags
  • 0x805A
  • 0x8060
  • 0x8079
But, today we found that in some machines email address is getting store in following tags
  • 0x8037
  • 0x807B
I guess, I am not doing something right(for getting the email address). Is there a better way to get the email address(for a given contact)?

Any help is appreciated.

Regards,
Rohan

New Post: How to get the EMail Address from a contact

$
0
0
You're looking at the property tag of a named property, which you can identify because the tag is > 0x8000. You need to be looking at the named property name. In MFCMAPI, that's a different column.

New Post: How to get the EMail Address from a contact

$
0
0
Thanks Griffin,
I shall check this, and let you know
Regards,
Rohan

New Post: How to get the EMail Address from a contact

$
0
0
Hi Griffin,

I am using following code

//#define PR_EMAIL1_ORIGINAL_DISPLAY_NAME 0x8084001E
void CMapiSession::GetContacts(LPMAPIFOLDER lpFolder)
{
HRESULT         hr              = S_OK;
LPMAPITABLE     lpContentsTable = NULL;
LPSRowSet               sRows = NULL;
enum {ePR_GIVEN_NAME ,                      
    ePR_EMAIL1_ORIGINAL_DISPLAY_NAME ,              
            ePR_BUSINESS_TELEPHONE_NUMBER ,                 
         NUM_COLS};

//These tags represent the message information we would like to pick up
static SizedSPropTagArray(NUM_COLS,sptCols) = { NUM_COLS,
                                                                        PR_GIVEN_NAME ,
                                                                        PR_EMAIL1_ORIGINAL_DISPLAY_NAME ,
                                                                         PR_BUSINESS_TELEPHONE_NUMBER };

hr = lpFolder->GetContentsTable(0, &lpContentsTable);

hr = HrQueryAllRows(    lpContentsTable,
                                 (LPSPropTagArray) &sptCols,
                                NULL,//restriction...we're not using this parameter
                                NULL,//sort order...we're not using this parameter
                                0,
                                &sRows);

for (unsigned int iIndex = 0; iIndex < sRows -> cRows; iIndex++)
{
    //do somethinbg
}
}

After spending couple of hours(reading and debugging MFCMAPI), following is my understanding
  • Since there is no fixed tag for "PR_EMAIL1_ORIGINAL_DISPLAY_NAME"(unlike PR_BUSINESS_TELEPHONE_NUMBER) we can NOT make use of GetContentsTable. Is this understanding right(or is there a workaround)?
  • We need to use GetProps(), and then use GetNamesFromIDs() to solve this problem.
Appreciate your feedback.

Regards,
Rohan

New Post: How to get the EMail Address from a contact

New Post: How to get the EMail Address from a contact

$
0
0
Thanks Griffin. I do appreciate your help.

New Post: Autodiscover

$
0
0
Please oh please! Make a AutoDiscover example!

New Post: Command Line EML import

$
0
0
Hello,

Is there a way to run a command line to have . EML messages in an OS folder imported into a PST folder?

While MFCMAPI can do it, you have establish the session, open the root folder, open the subfolder, start the import, confirm the defaults, then select the OS folder containing the .EML files. It would be nice if a single command line could just do the work.

exe /importfromeml /source:c:\emlfiles*.* /destination:outlook.pst\emlimport

or something like that :)

Thank you,
Dominic

New Post: Command Line EML import

$
0
0
All of MrMAPI's functions revolve around exporting data. Importing data is something I'm not sure I want to be automatable using my code.
Viewing all 1090 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>