Thank you for your quick response. I will try the same and update you.
↧
New Post: Outlook 2007 does not terminate after the MapiLogonEx
↧
New Post: Error : Cannot open your default e-mail folders. the file ..outlook.pst is in use and cannot be accessed.
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
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
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.
Unless you're calling into Simple MAPI, MapiLogOff isn't a MAPI function, so I assume it's something you wrote. Further, I assume in there you're calling IMAPISession::Logoff (http://msdn.microsoft.com/en-us/library/office/cc842296(v=office.15).aspx). I've found it best not to call that function. Try removing it (but otherwise releasing everything normally) and see what happens.
↧
New Post: Error : Cannot open your default e-mail folders. the file ..outlook.pst is in use and cannot be accessed.
I am calling IMAPISession::Logoff().
I did following minor code change which seemed to have solved this issue.
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]
↧
New Post: Problems with opening new sessions in MCFMAPI Feb 2014 release
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!
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
What steps are you following to create a new profile?
↧
New Post: Problems with opening new sessions in MCFMAPI Feb 2014 release
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
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
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
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
Problem: Add feature to add attachments to a message
Fix: Done
↧
New Post: How to get the EMail Address from a contact
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
Any help is appreciated.
Regards,
Rohan
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
- 0x8037
-
0x807B
Any help is appreciated.
Regards,
Rohan
↧
New Post: How to get the EMail Address from a contact
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
Thanks Griffin,
I shall check this, and let you know
Regards,
Rohan
I shall check this, and let you know
Regards,
Rohan
↧
New Post: How to get the EMail Address from a contact
Hi Griffin,
I am using following code
//#define PR_EMAIL1_ORIGINAL_DISPLAY_NAME 0x8084001E
void CMapiSession::GetContacts(LPMAPIFOLDER lpFolder)
{
After spending couple of hours(reading and debugging MFCMAPI), following is my understanding
Regards,
Rohan
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.
Regards,
Rohan
↧
New Post: How to get the EMail Address from a contact
You're trying to get a named property. You need to use GetIDsFromNames to map the name of the property to the property tag you can use to retrieve the property. I would study this before proceeding:
http://msdn.microsoft.com/en-us/library/office/cc765864(v=office.15).aspx
Once you understand named properties, here's the Contact documentation that will tell you which named properties to fetch:
http://msdn.microsoft.com/en-us/library/ee178937(v=EXCHG.80).aspx
http://msdn.microsoft.com/en-us/library/office/cc765864(v=office.15).aspx
Once you understand named properties, here's the Contact documentation that will tell you which named properties to fetch:
http://msdn.microsoft.com/en-us/library/ee178937(v=EXCHG.80).aspx
↧
New Post: How to get the EMail Address from a contact
Thanks Griffin. I do appreciate your help.
↧
↧
New Post: Autodiscover
Please oh please! Make a AutoDiscover example!
↧
New Post: Command Line EML import
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
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
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.
↧