|
It happens in the codeplex project but not in the latest mud.ca version. OK, thanks.
|
|
|
|
|
Ok cool, I really have to update the code on CodeProject, I just haven't had time to package it up with the new VS2012 projects.
|
|
|
|
|
I wrote a routine to open a folder based on its entry id. Sharing in case helpful:
CMAPIFolder* CMAPIEx::OpenFolderByEntryId(LPCTSTR szEntryId, BOOL bInternal)
{
if(!m_pMsgStore) return NULL;
DWORD dwObjType;
LPMAPIFOLDER pFolder;
std::vector<unsigned char=""> binVector;
binVector = CMAPIObject::HexStringToBinary(szEntryId);
if(binVector.size() > 0)
{
SBinary bin;
bin.cb = binVector.size();
bin.lpb = &binVector[0];
if(m_pMsgStore->OpenEntry(bin.cb, (LPENTRYID)bin.lpb, NULL, m_ulMDBFlags, &dwObjType, (LPUNKNOWN*)&pFolder)!=S_OK) return NULL;
if(pFolder)
{
CMAPIFolder* pMAPIFolder=new CMAPIFolder(this, pFolder);
if(bInternal)
{
delete m_pFolder;
m_pFolder=pMAPIFolder;
}
return pMAPIFolder;
}
}
return NULL;
}
and here's its helper routine:
std::vector<unsigned char=""> CMAPIObject::HexStringToBinary(const CString cs)
{
// CString to std string
// http://codeproject.com/Tips/273714/Cplusplus-Converting-an-MFC-CString-to-a-std-strin
std::wstring ws(cs);
std::string s;
s.assign(ws.begin(), ws.end());
// add spaces after every two characters, since that's what hex expects (e.g. ACF203 becomes AC F2 03)
// http://stackoverflow.com/questions/9612079/loop-to-keep-adding-spaces-in-string
std::string X;
int i;
int y;
X = s;
y= X.size();
for(i=2;i<y;i+=2)
{
="" x.insert(i,"="" ");
="" y="X.size();" to="" update="" size="" of="" x
="" i++;="" skip="" the="" inserted="" space
="" }
="" use="" vector="" for="" bytes
="" http:="" stackoverflow.com="" questions="" 13942433="" string-of-hex-to-hex-bytes
="" ideone.com="" htjmzj
="" std::vector<unsigned="" char=""> v;
std::istringstream in(X);
in >> std::hex;
unsigned short c;
while (in >> c) v.push_back(static_cast<unsigned char="">(c));
return v;
}
|
|
|
|
|
An important and well-kept library
|
|
|
|
|
Hi Noel, MFCMapi and my Outlook VBA code both agree that a particular EntryId is:
000000003820259D6A8B3F4E9816AD7C0C28C25B0700EE61992CDE079B40A1E41FE4224DA3AB000000EBEF000000EE61992CDE079B40A1E41FE4224DA3AB000000ECEF6C0000
However, that same EntryId in MAPIEx is shown as:
EF0000003820259D6A8B3F4E9816AD7C0C28C25B04202000
At first I thought it was a possible bug in GetHexString / GetEntryIDString (I'm x64/unicode). But after further research I'm wondering if it has something to do with short term vs. long term PR_ENTRYID? Any ideas on this? I want to store the EntryId that I can later use to fetch the message.
Thanks!
modified 5-May-13 7:43am.
|
|
|
|
|
False alarm. I just learned that there are two flavors of the EntryId and both are valid (link[^]).
|
|
|
|
|
Cool, at first I thought perhaps the 64 bit outlook had some new longer entryID but I see there's two.
|
|
|
|
|
For those struggling with the situation of users who have multiple profiles and Outlook is not open (and where no default profile is set), this edit to MAPIEx.cpp could be helpful to you:
BOOL CMAPIEx::Login(LPCTSTR szProfileName, BOOL bInitAsService)
{
//DWORD dwFlags=MAPI_EXTENDED | MAPI_USE_DEFAULT | MAPI_NEW_SESSION;
//if(bInitAsService) dwFlags|=MAPI_EXPLICIT_PROFILE | MAPI_NT_SERVICE;
DWORD dwFlags=MAPI_EXTENDED | MAPI_UNICODE;
if(bInitAsService) dwFlags|=MAPI_NT_SERVICE;
if(szProfileName == nullptr)
{
dwFlags|= MAPI_LOGON_UI;
}
else
{
dwFlags|= MAPI_EXPLICIT_PROFILE | MAPI_NEW_SESSION;
}
return (MAPILogonEx(NULL, (LPTSTR)szProfileName, NULL, dwFlags, &m_pSession)==S_OK);
}
|
|
|
|
|
Nice I'll add this to the api somehow (pass in value etc)
|
|
|
|
|
void COutlookDlg::OnBnClickedButtonDisplay()
{
if(mapi.OpenRootFolder() && mapi.GetHierarchy())
{
CString strfolder;
CMAPIFolder folder;
while(mapi.GetNextSubFolder(folder,strfolder))
{
if(folder.m_type == L"IPF.Contact")
{
displaycontactdata(mapi,folder);
enumeratefolder(mapi,folder);
}
}
}
DisplayDATA data;
data.displaydata(fullname,email,displayas,company,mobileno);
data.DoModal();
}
void COutlookDlg::displaycontactdata(CMAPIEx& mapi,CMAPIFolder& folder)
{
CString text;
int index = m_contactlist.GetCurSel();
m_contactlist.GetText(index,text);
if(mapi.OpenContacts() && folder.GetContents())
{
folder.SortContents(TABLE_SORT_ASCEND,PR_SUBJECT);
CString strtext;
CMAPIContact contact;
while(folder.GetNextContact(contact))
{
contact.GetName(strtext);
if(strtext.Compare(text) == 0)
{
fullname = text;
contact.GetEmail(strtext);
email = strtext;
contact.GetCompany(strtext);
company = strtext;
contact.GetDisplayNamePrefix(strtext);
displayas = strtext;
contact.GetPhoneNumber(strtext,PR_BUSINESS2_TELEPHONE_NUMBER);
mobileno = strtext;
break;
}
}
}
}
void COutlookDlg::enumeratefolder(CMAPIEx& mapi, CMAPIFolder& folder)
{
if(folder.GetHierarchy())
{
CString strfolder;
CMAPIFolder subfolderoffolder;
while(folder.GetNextSubFolder(subfolderoffolder,strfolder))
{
if(folder.m_type == L"IPF.Contact")
{
displaycontactdata(mapi,folder);
enumeratefolder(mapi,subfolderoffolder);
}
}
}
}
Vijay Kumbhani
|
|
|
|
|
For those looking to manage one .NET solution loading the appropriate x86/x64 dll, I wanted to share one possible solution. I'm planning to make two MapiEx project files, one called MapiEx32 and one called MapiEx64, each using the same c++ code. In Solution Configuration Manager I have one of those projects building to Win32 and one to x64. Then I'm planning to use Louis.fr's answer from here[^] to handle conditional loading of MapiEx32.dll or MapiEx64.dll as appropriate. Sort of tedious, but here's the approach:
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint="ContactCreate")]
protected static extern bool ContactCreate32(IntPtr pMAPI, out IntPtr pContact, IntPtr pFolder);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint="ContactCreate")]
protected static extern bool ContactCreate64(IntPtr pMAPI, out IntPtr pContact, IntPtr pFolder);
protected static bool ContactCreate(IntPtr pMAPI, out IntPtr pContact, IntPtr pFolder)
{
if (IntPtr.Size * 8 == 32)
return ContactCreate32(pMAPI, out pContact, pFolder);
else
return ContactCreate64(pMAPI, out pContact, pFolder);
}
Then the rest of the code can continue to call ContactCreate.
Oh, btw, MAPIExDLL32 is of course a constant for "MapiEx32.dll".
modified 2-May-13 12:23pm.
|
|
|
|
|
Nice hack, I haven't really thought of a solution for this. Should help some people.
|
|
|
|
|
Well, it was every bit as tedious as I imagined, but here in case helpful to others are conditional DllImports. Please use at your own risk, as I have not checked all of these.
#region MAPIAppointment DLLCalls
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetSubject")]
protected static extern bool AppointmentGetSubject32(IntPtr pAppointment, StringBuilder strSubject, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetSubject")]
protected static extern bool AppointmentGetSubject64(IntPtr pAppointment, StringBuilder strSubject, int nMaxLength);
protected static bool AppointmentGetSubject(IntPtr pAppointment, StringBuilder strSubject, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return AppointmentGetSubject32(pAppointment, strSubject, nMaxLength);
else
return AppointmentGetSubject64(pAppointment, strSubject, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetLocation")]
protected static extern bool AppointmentGetLocation32(IntPtr pAppointment, StringBuilder strLocation, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetLocation")]
protected static extern bool AppointmentGetLocation64(IntPtr pAppointment, StringBuilder strLocation, int nMaxLength);
protected static bool AppointmentGetLocation(IntPtr pAppointment, StringBuilder strLocation, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return AppointmentGetLocation32(pAppointment, strLocation, nMaxLength);
else
return AppointmentGetLocation64(pAppointment, strLocation, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetStartTime")]
protected static extern bool AppointmentGetStartTime32(IntPtr pAppointment, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetStartTime")]
protected static extern bool AppointmentGetStartTime64(IntPtr pAppointment, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond);
protected static bool AppointmentGetStartTime(IntPtr pAppointment, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond)
{
if (IntPtr.Size * 8 == 32)
return AppointmentGetStartTime32(pAppointment, out nYear, out nMonth, out nDay, out nHour, out nMinute, out nSecond);
else
return AppointmentGetStartTime64(pAppointment, out nYear, out nMonth, out nDay, out nHour, out nMinute, out nSecond);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetStartTimeString")]
protected static extern bool AppointmentGetStartTimeString32(IntPtr pAppointment, StringBuilder strStartTime, int nMaxLength, string szFormat);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetStartTimeString")]
protected static extern bool AppointmentGetStartTimeString64(IntPtr pAppointment, StringBuilder strStartTime, int nMaxLength, string szFormat);
protected static bool AppointmentGetStartTimeString(IntPtr pAppointment, StringBuilder strStartTime, int nMaxLength, string szFormat)
{
if (IntPtr.Size * 8 == 32)
return AppointmentGetStartTimeString32(pAppointment, strStartTime, nMaxLength, szFormat);
else
return AppointmentGetStartTimeString64(pAppointment, strStartTime, nMaxLength, szFormat);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetEndTime")]
protected static extern bool AppointmentGetEndTime32(IntPtr pAppointment, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetEndTime")]
protected static extern bool AppointmentGetEndTime64(IntPtr pAppointment, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond);
protected static bool AppointmentGetEndTime(IntPtr pAppointment, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond)
{
if (IntPtr.Size * 8 == 32)
return AppointmentGetEndTime32(pAppointment, out nYear, out nMonth, out nDay, out nHour, out nMinute, out nSecond);
else
return AppointmentGetEndTime64(pAppointment, out nYear, out nMonth, out nDay, out nHour, out nMinute, out nSecond);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetEndTimeString")]
protected static extern bool AppointmentGetEndTimeString32(IntPtr pAppointment, StringBuilder strEndTime, int nMaxLength, string szFormat);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentGetEndTimeString")]
protected static extern bool AppointmentGetEndTimeString64(IntPtr pAppointment, StringBuilder strEndTime, int nMaxLength, string szFormat);
protected static bool AppointmentGetEndTimeString(IntPtr pAppointment, StringBuilder strEndTime, int nMaxLength, string szFormat)
{
if (IntPtr.Size * 8 == 32)
return AppointmentGetEndTimeString32(pAppointment, strEndTime, nMaxLength, szFormat);
else
return AppointmentGetEndTimeString64(pAppointment, strEndTime, nMaxLength, szFormat);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentSetSubject")]
protected static extern bool AppointmentSetSubject32(IntPtr pAppointment, string strSubject);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentSetSubject")]
protected static extern bool AppointmentSetSubject64(IntPtr pAppointment, string strSubject);
protected static bool AppointmentSetSubject(IntPtr pAppointment, string strSubject)
{
if (IntPtr.Size * 8 == 32)
return AppointmentSetSubject32(pAppointment, strSubject);
else
return AppointmentSetSubject64(pAppointment, strSubject);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentSetLocation")]
protected static extern bool AppointmentSetLocation32(IntPtr pAppointment, string strLocation);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentSetLocation")]
protected static extern bool AppointmentSetLocation64(IntPtr pAppointment, string strLocation);
protected static bool AppointmentSetLocation(IntPtr pAppointment, string strLocation)
{
if (IntPtr.Size * 8 == 32)
return AppointmentSetLocation32(pAppointment, strLocation);
else
return AppointmentSetLocation64(pAppointment, strLocation);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentSetStartTime")]
protected static extern bool AppointmentSetStartTime32(IntPtr pAppointment, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentSetStartTime")]
protected static extern bool AppointmentSetStartTime64(IntPtr pAppointment, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond);
protected static bool AppointmentSetStartTime(IntPtr pAppointment, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond)
{
if (IntPtr.Size * 8 == 32)
return AppointmentSetStartTime32(pAppointment, nYear, nMonth, nDay, nHour, nMinute, nSecond);
else
return AppointmentSetStartTime64(pAppointment, nYear, nMonth, nDay, nHour, nMinute, nSecond);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentSetEndTime")]
protected static extern bool AppointmentSetEndTime32(IntPtr pAppointment, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AppointmentSetEndTime")]
protected static extern bool AppointmentSetEndTime64(IntPtr pAppointment, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond);
protected static bool AppointmentSetEndTime(IntPtr pAppointment, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond)
{
if (IntPtr.Size * 8 == 32)
return AppointmentSetEndTime32(pAppointment, nYear, nMonth, nDay, nHour, nMinute, nSecond);
else
return AppointmentSetEndTime64(pAppointment, nYear, nMonth, nDay, nHour, nMinute, nSecond);
}
#endregion
#region MAPIContact DLLCalls
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactCreate")]
protected static extern bool ContactCreate32(IntPtr pMAPI, out IntPtr pContact, IntPtr pFolder);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactCreate")]
protected static extern bool ContactCreate64(IntPtr pMAPI, out IntPtr pContact, IntPtr pFolder);
protected static bool ContactCreate(IntPtr pMAPI, out IntPtr pContact, IntPtr pFolder)
{
if (IntPtr.Size * 8 == 32)
return ContactCreate32(pMAPI, out pContact, pFolder);
else
return ContactCreate64(pMAPI, out pContact, pFolder);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetName")]
protected static extern bool ContactGetName32(IntPtr pContact, StringBuilder strName, int nMaxLength, int nType);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetName")]
protected static extern bool ContactGetName64(IntPtr pContact, StringBuilder strName, int nMaxLength, int nType);
protected static bool ContactGetName(IntPtr pContact, StringBuilder strName, int nMaxLength, int nType)
{
if (IntPtr.Size * 8 == 32)
return ContactGetName32(pContact, strName, nMaxLength, nType);
else
return ContactGetName64(pContact, strName, nMaxLength, nType);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetEmail")]
protected static extern bool ContactGetEmail32(IntPtr pContact, StringBuilder strEmail, int nMaxLength, int nIndex);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetEmail")]
protected static extern bool ContactGetEmail64(IntPtr pContact, StringBuilder strEmail, int nMaxLength, int nIndex);
protected static bool ContactGetEmail(IntPtr pContact, StringBuilder strEmail, int nMaxLength, int nIndex)
{
if (IntPtr.Size * 8 == 32)
return ContactGetEmail32(pContact, strEmail, nMaxLength, nIndex);
else
return ContactGetEmail64(pContact, strEmail, nMaxLength, nIndex);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetEmailDisplayAs")]
protected static extern bool ContactGetEmailDisplayAs32(IntPtr pContact, StringBuilder strDisplayAs, int nMaxLength, int nIndex);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetEmailDisplayAs")]
protected static extern bool ContactGetEmailDisplayAs64(IntPtr pContact, StringBuilder strDisplayAs, int nMaxLength, int nIndex);
protected static bool ContactGetEmailDisplayAs(IntPtr pContact, StringBuilder strDisplayAs, int nMaxLength, int nIndex)
{
if (IntPtr.Size * 8 == 32)
return ContactGetEmailDisplayAs32(pContact, strDisplayAs, nMaxLength, nIndex);
else
return ContactGetEmailDisplayAs64(pContact, strDisplayAs, nMaxLength, nIndex);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetHomePage")]
protected static extern bool ContactGetHomePage32(IntPtr pContact, StringBuilder strHomePage, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetHomePage")]
protected static extern bool ContactGetHomePage64(IntPtr pContact, StringBuilder strHomePage, int nMaxLength);
protected static bool ContactGetHomePage(IntPtr pContact, StringBuilder strHomePage, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetHomePage32(pContact, strHomePage, nMaxLength);
else
return ContactGetHomePage64(pContact, strHomePage, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetIMAddress")]
protected static extern bool ContactGetIMAddress32(IntPtr pContact, StringBuilder strIMAddress, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetIMAddress")]
protected static extern bool ContactGetIMAddress64(IntPtr pContact, StringBuilder strIMAddress, int nMaxLength);
protected static bool ContactGetIMAddress(IntPtr pContact, StringBuilder strIMAddress, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetIMAddress32(pContact, strIMAddress, nMaxLength);
else
return ContactGetIMAddress64(pContact, strIMAddress, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetProfession")]
protected static extern bool ContactGetProfession32(IntPtr pContact, StringBuilder strProfession, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetProfession")]
protected static extern bool ContactGetProfession64(IntPtr pContact, StringBuilder strProfession, int nMaxLength);
protected static bool ContactGetProfession(IntPtr pContact, StringBuilder strProfession, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetProfession32(pContact, strProfession, nMaxLength);
else
return ContactGetProfession64(pContact, strProfession, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetPhoneNumber")]
protected static extern bool ContactGetPhoneNumber32(IntPtr pContact, StringBuilder strPhoneNumber, int nMaxLength, int nType);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetPhoneNumber")]
protected static extern bool ContactGetPhoneNumber64(IntPtr pContact, StringBuilder strPhoneNumber, int nMaxLength, int nType);
protected static bool ContactGetPhoneNumber(IntPtr pContact, StringBuilder strPhoneNumber, int nMaxLength, int nType)
{
if (IntPtr.Size * 8 == 32)
return ContactGetPhoneNumber32(pContact, strPhoneNumber, nMaxLength, nType);
else
return ContactGetPhoneNumber64(pContact, strPhoneNumber, nMaxLength, nType);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetAddress")]
protected static extern bool ContactGetAddress32(IntPtr pContact, out IntPtr pAddress, int nType);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetAddress")]
protected static extern bool ContactGetAddress64(IntPtr pContact, out IntPtr pAddress, int nType);
protected static bool ContactGetAddress(IntPtr pContact, out IntPtr pAddress, int nType)
{
if (IntPtr.Size * 8 == 32)
return ContactGetAddress32(pContact, out pAddress, nType);
else
return ContactGetAddress64(pContact, out pAddress, nType);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetPostalAddress")]
protected static extern bool ContactGetPostalAddress32(IntPtr pContact, StringBuilder strAddress, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetPostalAddress")]
protected static extern bool ContactGetPostalAddress64(IntPtr pContact, StringBuilder strAddress, int nMaxLength);
protected static bool ContactGetPostalAddress(IntPtr pContact, StringBuilder strAddress, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetPostalAddress32(pContact, strAddress, nMaxLength);
else
return ContactGetPostalAddress64(pContact, strAddress, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetNotesSize")]
protected static extern int ContactGetNotesSize32(IntPtr pContact, bool bRTF);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetNotesSize")]
protected static extern int ContactGetNotesSize64(IntPtr pContact, bool bRTF);
protected static int ContactGetNotesSize(IntPtr pContact, bool bRTF)
{
if (IntPtr.Size * 8 == 32)
return ContactGetNotesSize32(pContact, bRTF);
else
return ContactGetNotesSize64(pContact, bRTF);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetNotes")]
protected static extern bool ContactGetNotes32(IntPtr pContact, StringBuilder strNotes, int nMaxLength, bool bRTF);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetNotes")]
protected static extern bool ContactGetNotes64(IntPtr pContact, StringBuilder strNotes, int nMaxLength, bool bRTF);
protected static bool ContactGetNotes(IntPtr pContact, StringBuilder strNotes, int nMaxLength, bool bRTF)
{
if (IntPtr.Size * 8 == 32)
return ContactGetNotes32(pContact, strNotes, nMaxLength, bRTF);
else
return ContactGetNotes64(pContact, strNotes, nMaxLength, bRTF);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetSensitivity")]
protected static extern int ContactGetSensitivity32(IntPtr pContact);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetSensitivity")]
protected static extern int ContactGetSensitivity64(IntPtr pContact);
protected static int ContactGetSensitivity(IntPtr pContact)
{
if (IntPtr.Size * 8 == 32)
return ContactGetSensitivity32(pContact);
else
return ContactGetSensitivity64(pContact);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetTitle")]
protected static extern bool ContactGetTitle32(IntPtr pContact, StringBuilder strTitle, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetTitle")]
protected static extern bool ContactGetTitle64(IntPtr pContact, StringBuilder strTitle, int nMaxLength);
protected static bool ContactGetTitle(IntPtr pContact, StringBuilder strTitle, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetTitle32(pContact, strTitle, nMaxLength);
else
return ContactGetTitle64(pContact, strTitle, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetCompany")]
protected static extern bool ContactGetCompany32(IntPtr pContact, StringBuilder strCompany, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetCompany")]
protected static extern bool ContactGetCompany64(IntPtr pContact, StringBuilder strCompany, int nMaxLength);
protected static bool ContactGetCompany(IntPtr pContact, StringBuilder strCompany, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetCompany32(pContact, strCompany, nMaxLength);
else
return ContactGetCompany64(pContact, strCompany, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetDisplayNamePrefix")]
protected static extern bool ContactGetDisplayNamePrefix32(IntPtr pContact, StringBuilder strDisplayNamePrefix, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetDisplayNamePrefix")]
protected static extern bool ContactGetDisplayNamePrefix64(IntPtr pContact, StringBuilder strDisplayNamePrefix, int nMaxLength);
protected static bool ContactGetDisplayNamePrefix(IntPtr pContact, StringBuilder strDisplayNamePrefix, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetDisplayNamePrefix32(pContact, strDisplayNamePrefix, nMaxLength);
else
return ContactGetDisplayNamePrefix64(pContact, strDisplayNamePrefix, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetGeneration")]
protected static extern bool ContactGetGeneration32(IntPtr pContact, StringBuilder strGeneration, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetGeneration")]
protected static extern bool ContactGetGeneration64(IntPtr pContact, StringBuilder strGeneration, int nMaxLength);
protected static bool ContactGetGeneration(IntPtr pContact, StringBuilder strGeneration, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetGeneration32(pContact, strGeneration, nMaxLength);
else
return ContactGetGeneration64(pContact, strGeneration, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetDepartment")]
protected static extern bool ContactGetDepartment32(IntPtr pContact, StringBuilder strDepartment, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetDepartment")]
protected static extern bool ContactGetDepartment64(IntPtr pContact, StringBuilder strDepartment, int nMaxLength);
protected static bool ContactGetDepartment(IntPtr pContact, StringBuilder strDepartment, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetDepartment32(pContact, strDepartment, nMaxLength);
else
return ContactGetDepartment64(pContact, strDepartment, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetOffice")]
protected static extern bool ContactGetOffice32(IntPtr pContact, StringBuilder strOffice, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetOffice")]
protected static extern bool ContactGetOffice64(IntPtr pContact, StringBuilder strOffice, int nMaxLength);
protected static bool ContactGetOffice(IntPtr pContact, StringBuilder strOffice, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetOffice32(pContact, strOffice, nMaxLength);
else
return ContactGetOffice64(pContact, strOffice, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetManagerName")]
protected static extern bool ContactGetManagerName32(IntPtr pContact, StringBuilder strManagerName, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetManagerName")]
protected static extern bool ContactGetManagerName64(IntPtr pContact, StringBuilder strManagerName, int nMaxLength);
protected static bool ContactGetManagerName(IntPtr pContact, StringBuilder strManagerName, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetManagerName32(pContact, strManagerName, nMaxLength);
else
return ContactGetManagerName64(pContact, strManagerName, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetAssistantName")]
protected static extern bool ContactGetAssistantName32(IntPtr pContact, StringBuilder strAssistantName, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetAssistantName")]
protected static extern bool ContactGetAssistantName64(IntPtr pContact, StringBuilder strAssistantName, int nMaxLength);
protected static bool ContactGetAssistantName(IntPtr pContact, StringBuilder strAssistantName, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetAssistantName32(pContact, strAssistantName, nMaxLength);
else
return ContactGetAssistantName64(pContact, strAssistantName, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetNickName")]
protected static extern bool ContactGetNickName32(IntPtr pContact, StringBuilder strNickName, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetNickName")]
protected static extern bool ContactGetNickName64(IntPtr pContact, StringBuilder strNickName, int nMaxLength);
protected static bool ContactGetNickName(IntPtr pContact, StringBuilder strNickName, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetNickName32(pContact, strNickName, nMaxLength);
else
return ContactGetNickName64(pContact, strNickName, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetSpouseName")]
protected static extern bool ContactGetSpouseName32(IntPtr pContact, StringBuilder strSpouseName, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetSpouseName")]
protected static extern bool ContactGetSpouseName64(IntPtr pContact, StringBuilder strSpouseName, int nMaxLength);
protected static bool ContactGetSpouseName(IntPtr pContact, StringBuilder strSpouseName, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetSpouseName32(pContact, strSpouseName, nMaxLength);
else
return ContactGetSpouseName64(pContact, strSpouseName, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetBirthday")]
protected static extern bool ContactGetBirthday32(IntPtr pContact, out int nYear, out int nMonth, out int nDay);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetBirthday")]
protected static extern bool ContactGetBirthday64(IntPtr pContact, out int nYear, out int nMonth, out int nDay);
protected static bool ContactGetBirthday(IntPtr pContact, out int nYear, out int nMonth, out int nDay)
{
if (IntPtr.Size * 8 == 32)
return ContactGetBirthday32(pContact, out nYear, out nMonth, out nDay);
else
return ContactGetBirthday64(pContact, out nYear, out nMonth, out nDay);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetAnniversary")]
protected static extern bool ContactGetAnniversary32(IntPtr pContact, out int nYear, out int nMonth, out int nDay);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetAnniversary")]
protected static extern bool ContactGetAnniversary64(IntPtr pContact, out int nYear, out int nMonth, out int nDay);
protected static bool ContactGetAnniversary(IntPtr pContact, out int nYear, out int nMonth, out int nDay)
{
if (IntPtr.Size * 8 == 32)
return ContactGetAnniversary32(pContact, out nYear, out nMonth, out nDay);
else
return ContactGetAnniversary64(pContact, out nYear, out nMonth, out nDay);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetCategories")]
protected static extern bool ContactGetCategories32(IntPtr pContact, StringBuilder strField, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactGetCategories")]
protected static extern bool ContactGetCategories64(IntPtr pContact, StringBuilder strField, int nMaxLength);
protected static bool ContactGetCategories(IntPtr pContact, StringBuilder strField, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ContactGetCategories32(pContact, strField, nMaxLength);
else
return ContactGetCategories64(pContact, strField, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetName")]
protected static extern bool ContactSetName32(IntPtr pContact, string strName, int nType);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetName")]
protected static extern bool ContactSetName64(IntPtr pContact, string strName, int nType);
protected static bool ContactSetName(IntPtr pContact, string strName, int nType)
{
if (IntPtr.Size * 8 == 32)
return ContactSetName32(pContact, strName, nType);
else
return ContactSetName64(pContact, strName, nType);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetEmail")]
protected static extern bool ContactSetEmail32(IntPtr pContact, string strEmail, int nIndex);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetEmail")]
protected static extern bool ContactSetEmail64(IntPtr pContact, string strEmail, int nIndex);
protected static bool ContactSetEmail(IntPtr pContact, string strEmail, int nIndex)
{
if (IntPtr.Size * 8 == 32)
return ContactSetEmail32(pContact, strEmail, nIndex);
else
return ContactSetEmail64(pContact, strEmail, nIndex);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetEmailDisplayAs")]
protected static extern bool ContactSetEmailDisplayAs32(IntPtr pContact, string strDisplayAs, int nIndex);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetEmailDisplayAs")]
protected static extern bool ContactSetEmailDisplayAs64(IntPtr pContact, string strDisplayAs, int nIndex);
protected static bool ContactSetEmailDisplayAs(IntPtr pContact, string strDisplayAs, int nIndex)
{
if (IntPtr.Size * 8 == 32)
return ContactSetEmailDisplayAs32(pContact, strDisplayAs, nIndex);
else
return ContactSetEmailDisplayAs64(pContact, strDisplayAs, nIndex);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetHomePage")]
protected static extern bool ContactSetHomePage32(IntPtr pContact, string strHomePage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetHomePage")]
protected static extern bool ContactSetHomePage64(IntPtr pContact, string strHomePage);
protected static bool ContactSetHomePage(IntPtr pContact, string strHomePage)
{
if (IntPtr.Size * 8 == 32)
return ContactSetHomePage32(pContact, strHomePage);
else
return ContactSetHomePage64(pContact, strHomePage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetIMAddress")]
protected static extern bool ContactSetIMAddress32(IntPtr pContact, string strIMAddress);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetIMAddress")]
protected static extern bool ContactSetIMAddress64(IntPtr pContact, string strIMAddress);
protected static bool ContactSetIMAddress(IntPtr pContact, string strIMAddress)
{
if (IntPtr.Size * 8 == 32)
return ContactSetIMAddress32(pContact, strIMAddress);
else
return ContactSetIMAddress64(pContact, strIMAddress);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetProfession")]
protected static extern bool ContactSetProfession32(IntPtr pContact, string strProfession);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetProfession")]
protected static extern bool ContactSetProfession64(IntPtr pContact, string strProfession);
protected static bool ContactSetProfession(IntPtr pContact, string strProfession)
{
if (IntPtr.Size * 8 == 32)
return ContactSetProfession32(pContact, strProfession);
else
return ContactSetProfession64(pContact, strProfession);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetPhoneNumber")]
protected static extern bool ContactSetPhoneNumber32(IntPtr pContact, string strPhoneNumber, int nType);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetPhoneNumber")]
protected static extern bool ContactSetPhoneNumber64(IntPtr pContact, string strPhoneNumber, int nType);
protected static bool ContactSetPhoneNumber(IntPtr pContact, string strPhoneNumber, int nType)
{
if (IntPtr.Size * 8 == 32)
return ContactSetPhoneNumber32(pContact, strPhoneNumber, nType);
else
return ContactSetPhoneNumber64(pContact, strPhoneNumber, nType);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetAddress")]
protected static extern bool ContactSetAddress32(IntPtr pContact, IntPtr pAddress, int nType);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetAddress")]
protected static extern bool ContactSetAddress64(IntPtr pContact, IntPtr pAddress, int nType);
protected static bool ContactSetAddress(IntPtr pContact, IntPtr pAddress, int nType)
{
if (IntPtr.Size * 8 == 32)
return ContactSetAddress32(pContact, pAddress, nType);
else
return ContactSetAddress64(pContact, pAddress, nType);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetPostalAddress")]
protected static extern bool ContactSetPostalAddress32(IntPtr pContact, int nType);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetPostalAddress")]
protected static extern bool ContactSetPostalAddress64(IntPtr pContact, int nType);
protected static bool ContactSetPostalAddress(IntPtr pContact, int nType)
{
if (IntPtr.Size * 8 == 32)
return ContactSetPostalAddress32(pContact, nType);
else
return ContactSetPostalAddress64(pContact, nType);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactUpdateDisplayAddress")]
protected static extern bool ContactUpdateDisplayAddress32(IntPtr pContact, int nType);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactUpdateDisplayAddress")]
protected static extern bool ContactUpdateDisplayAddress64(IntPtr pContact, int nType);
protected static bool ContactUpdateDisplayAddress(IntPtr pContact, int nType)
{
if (IntPtr.Size * 8 == 32)
return ContactUpdateDisplayAddress32(pContact, nType);
else
return ContactUpdateDisplayAddress64(pContact, nType);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetNotes")]
protected static extern bool ContactSetNotes32(IntPtr pContact, string strNotes, bool bRTF);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetNotes")]
protected static extern bool ContactSetNotes64(IntPtr pContact, string strNotes, bool bRTF);
protected static bool ContactSetNotes(IntPtr pContact, string strNotes, bool bRTF)
{
if (IntPtr.Size * 8 == 32)
return ContactSetNotes32(pContact, strNotes, bRTF);
else
return ContactSetNotes64(pContact, strNotes, bRTF);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetSensitivity")]
protected static extern bool ContactSetSensitivity32(IntPtr pContact, int nSensitivity);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetSensitivity")]
protected static extern bool ContactSetSensitivity64(IntPtr pContact, int nSensitivity);
protected static bool ContactSetSensitivity(IntPtr pContact, int nSensitivity)
{
if (IntPtr.Size * 8 == 32)
return ContactSetSensitivity32(pContact, nSensitivity);
else
return ContactSetSensitivity64(pContact, nSensitivity);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetFileAs")]
protected static extern bool ContactSetFileAs32(IntPtr pContact, string strFileAs);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetFileAs")]
protected static extern bool ContactSetFileAs64(IntPtr pContact, string strFileAs);
protected static bool ContactSetFileAs(IntPtr pContact, string strFileAs)
{
if (IntPtr.Size * 8 == 32)
return ContactSetFileAs32(pContact, strFileAs);
else
return ContactSetFileAs64(pContact, strFileAs);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetTitle")]
protected static extern bool ContactSetTitle32(IntPtr pContact, string strTitle);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetTitle")]
protected static extern bool ContactSetTitle64(IntPtr pContact, string strTitle);
protected static bool ContactSetTitle(IntPtr pContact, string strTitle)
{
if (IntPtr.Size * 8 == 32)
return ContactSetTitle32(pContact, strTitle);
else
return ContactSetTitle64(pContact, strTitle);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetCompany")]
protected static extern bool ContactSetCompany32(IntPtr pContact, string strCompany);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetCompany")]
protected static extern bool ContactSetCompany64(IntPtr pContact, string strCompany);
protected static bool ContactSetCompany(IntPtr pContact, string strCompany)
{
if (IntPtr.Size * 8 == 32)
return ContactSetCompany32(pContact, strCompany);
else
return ContactSetCompany64(pContact, strCompany);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetDisplayNamePrefix")]
protected static extern bool ContactSetDisplayNamePrefix32(IntPtr pContact, string strPrefix);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetDisplayNamePrefix")]
protected static extern bool ContactSetDisplayNamePrefix64(IntPtr pContact, string strPrefix);
protected static bool ContactSetDisplayNamePrefix(IntPtr pContact, string strPrefix)
{
if (IntPtr.Size * 8 == 32)
return ContactSetDisplayNamePrefix32(pContact, strPrefix);
else
return ContactSetDisplayNamePrefix64(pContact, strPrefix);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetGeneration")]
protected static extern bool ContactSetGeneration32(IntPtr pContact, string strGeneration);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetGeneration")]
protected static extern bool ContactSetGeneration64(IntPtr pContact, string strGeneration);
protected static bool ContactSetGeneration(IntPtr pContact, string strGeneration)
{
if (IntPtr.Size * 8 == 32)
return ContactSetGeneration32(pContact, strGeneration);
else
return ContactSetGeneration64(pContact, strGeneration);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactUpdateDisplayName")]
protected static extern bool ContactUpdateDisplayName32(IntPtr pContact);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactUpdateDisplayName")]
protected static extern bool ContactUpdateDisplayName64(IntPtr pContact);
protected static bool ContactUpdateDisplayName(IntPtr pContact)
{
if (IntPtr.Size * 8 == 32)
return ContactUpdateDisplayName32(pContact);
else
return ContactUpdateDisplayName64(pContact);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetDepartment")]
protected static extern bool ContactSetDepartment32(IntPtr pContact, string strDepartment);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetDepartment")]
protected static extern bool ContactSetDepartment64(IntPtr pContact, string strDepartment);
protected static bool ContactSetDepartment(IntPtr pContact, string strDepartment)
{
if (IntPtr.Size * 8 == 32)
return ContactSetDepartment32(pContact, strDepartment);
else
return ContactSetDepartment64(pContact, strDepartment);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetOffice")]
protected static extern bool ContactSetOffice32(IntPtr pContact, string strOffice);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetOffice")]
protected static extern bool ContactSetOffice64(IntPtr pContact, string strOffice);
protected static bool ContactSetOffice(IntPtr pContact, string strOffice)
{
if (IntPtr.Size * 8 == 32)
return ContactSetOffice32(pContact, strOffice);
else
return ContactSetOffice64(pContact, strOffice);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetManagerName")]
protected static extern bool ContactSetManagerName32(IntPtr pContact, string strManagerName);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetManagerName")]
protected static extern bool ContactSetManagerName64(IntPtr pContact, string strManagerName);
protected static bool ContactSetManagerName(IntPtr pContact, string strManagerName)
{
if (IntPtr.Size * 8 == 32)
return ContactSetManagerName32(pContact, strManagerName);
else
return ContactSetManagerName64(pContact, strManagerName);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetAssistantName")]
protected static extern bool ContactSetAssistantName32(IntPtr pContact, string strAssistantName);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetAssistantName")]
protected static extern bool ContactSetAssistantName64(IntPtr pContact, string strAssistantName);
protected static bool ContactSetAssistantName(IntPtr pContact, string strAssistantName)
{
if (IntPtr.Size * 8 == 32)
return ContactSetAssistantName32(pContact, strAssistantName);
else
return ContactSetAssistantName64(pContact, strAssistantName);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetNickName")]
protected static extern bool ContactSetNickName32(IntPtr pContact, string strNickName);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetNickName")]
protected static extern bool ContactSetNickName64(IntPtr pContact, string strNickName);
protected static bool ContactSetNickName(IntPtr pContact, string strNickName)
{
if (IntPtr.Size * 8 == 32)
return ContactSetNickName32(pContact, strNickName);
else
return ContactSetNickName64(pContact, strNickName);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetSpouseName")]
protected static extern bool ContactSetSpouseName32(IntPtr pContact, string strSpouseName);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetSpouseName")]
protected static extern bool ContactSetSpouseName64(IntPtr pContact, string strSpouseName);
protected static bool ContactSetSpouseName(IntPtr pContact, string strSpouseName)
{
if (IntPtr.Size * 8 == 32)
return ContactSetSpouseName32(pContact, strSpouseName);
else
return ContactSetSpouseName64(pContact, strSpouseName);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetBirthday")]
protected static extern bool ContactSetBirthday32(IntPtr pContact, int nYear, int nMonth, int nDay);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetBirthday")]
protected static extern bool ContactSetBirthday64(IntPtr pContact, int nYear, int nMonth, int nDay);
protected static bool ContactSetBirthday(IntPtr pContact, int nYear, int nMonth, int nDay)
{
if (IntPtr.Size * 8 == 32)
return ContactSetBirthday32(pContact, nYear, nMonth, nDay);
else
return ContactSetBirthday64(pContact, nYear, nMonth, nDay);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetAnniversary")]
protected static extern bool ContactSetAnniversary32(IntPtr pContact, int nYear, int nMonth, int nDay);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetAnniversary")]
protected static extern bool ContactSetAnniversary64(IntPtr pContact, int nYear, int nMonth, int nDay);
protected static bool ContactSetAnniversary(IntPtr pContact, int nYear, int nMonth, int nDay)
{
if (IntPtr.Size * 8 == 32)
return ContactSetAnniversary32(pContact, nYear, nMonth, nDay);
else
return ContactSetAnniversary64(pContact, nYear, nMonth, nDay);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetCategories")]
protected static extern bool ContactSetCategories32(IntPtr pContact, string strCategories);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetCategories")]
protected static extern bool ContactSetCategories64(IntPtr pContact, string strCategories);
protected static bool ContactSetCategories(IntPtr pContact, string strCategories)
{
if (IntPtr.Size * 8 == 32)
return ContactSetCategories32(pContact, strCategories);
else
return ContactSetCategories64(pContact, strCategories);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetPicture")]
protected static extern bool ContactSetPicture32(IntPtr pContact, string strPath);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ContactSetPicture")]
protected static extern bool ContactSetPicture64(IntPtr pContact, string strPath);
protected static bool ContactSetPicture(IntPtr pContact, string strPath)
{
if (IntPtr.Size * 8 == 32)
return ContactSetPicture32(pContact, strPath);
else
return ContactSetPicture64(pContact, strPath);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressClose")]
protected static extern void AddressClose32(IntPtr pAddress);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressClose")]
protected static extern void AddressClose64(IntPtr pAddress);
protected static void AddressClose(IntPtr pAddress)
{
if (IntPtr.Size * 8 == 32)
AddressClose32(pAddress);
else
AddressClose64(pAddress);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressGetStreet")]
protected static extern void AddressGetStreet32(IntPtr pAddress, StringBuilder strStreet, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressGetStreet")]
protected static extern void AddressGetStreet64(IntPtr pAddress, StringBuilder strStreet, int nMaxLength);
protected static void AddressGetStreet(IntPtr pAddress, StringBuilder strStreet, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
AddressGetStreet32(pAddress, strStreet, nMaxLength);
else
AddressGetStreet64(pAddress, strStreet, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressGetCity")]
protected static extern void AddressGetCity32(IntPtr pAddress, StringBuilder strCity, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressGetCity")]
protected static extern void AddressGetCity64(IntPtr pAddress, StringBuilder strCity, int nMaxLength);
protected static void AddressGetCity(IntPtr pAddress, StringBuilder strCity, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
AddressGetCity32(pAddress, strCity, nMaxLength);
else
AddressGetCity64(pAddress, strCity, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressGetStateOrProvince")]
protected static extern void AddressGetStateOrProvince32(IntPtr pAddress, StringBuilder strStateOrProvince, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressGetStateOrProvince")]
protected static extern void AddressGetStateOrProvince64(IntPtr pAddress, StringBuilder strStateOrProvince, int nMaxLength);
protected static void AddressGetStateOrProvince(IntPtr pAddress, StringBuilder strStateOrProvince, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
AddressGetStateOrProvince32(pAddress, strStateOrProvince, nMaxLength);
else
AddressGetStateOrProvince64(pAddress, strStateOrProvince, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressGetPostalCode")]
protected static extern void AddressGetPostalCode32(IntPtr pAddress, StringBuilder strPostalCode, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressGetPostalCode")]
protected static extern void AddressGetPostalCode64(IntPtr pAddress, StringBuilder strPostalCode, int nMaxLength);
protected static void AddressGetPostalCode(IntPtr pAddress, StringBuilder strPostalCode, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
AddressGetPostalCode32(pAddress, strPostalCode, nMaxLength);
else
AddressGetPostalCode64(pAddress, strPostalCode, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressGetCountry")]
protected static extern void AddressGetCountry32(IntPtr pAddress, StringBuilder strCountry, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressGetCountry")]
protected static extern void AddressGetCountry64(IntPtr pAddress, StringBuilder strCountry, int nMaxLength);
protected static void AddressGetCountry(IntPtr pAddress, StringBuilder strCountry, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
AddressGetCountry32(pAddress, strCountry, nMaxLength);
else
AddressGetCountry64(pAddress, strCountry, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressSetStreet")]
protected static extern void AddressSetStreet32(IntPtr pAddress, string strStreet);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressSetStreet")]
protected static extern void AddressSetStreet64(IntPtr pAddress, string strStreet);
protected static void AddressSetStreet(IntPtr pAddress, string strStreet)
{
if (IntPtr.Size * 8 == 32)
AddressSetStreet32(pAddress, strStreet);
else
AddressSetStreet64(pAddress, strStreet);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressSetCity")]
protected static extern void AddressSetCity32(IntPtr pAddress, string strCity);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressSetCity")]
protected static extern void AddressSetCity64(IntPtr pAddress, string strCity);
protected static void AddressSetCity(IntPtr pAddress, string strCity)
{
if (IntPtr.Size * 8 == 32)
AddressSetCity32(pAddress, strCity);
else
AddressSetCity64(pAddress, strCity);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressSetStateOrProvince")]
protected static extern void AddressSetStateOrProvince32(IntPtr pAddress, string strStateOrProvince);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressSetStateOrProvince")]
protected static extern void AddressSetStateOrProvince64(IntPtr pAddress, string strStateOrProvince);
protected static void AddressSetStateOrProvince(IntPtr pAddress, string strStateOrProvince)
{
if (IntPtr.Size * 8 == 32)
AddressSetStateOrProvince32(pAddress, strStateOrProvince);
else
AddressSetStateOrProvince64(pAddress, strStateOrProvince);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressSetPostalCode")]
protected static extern void AddressSetPostalCode32(IntPtr pAddress, string strPostalCode);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressSetPostalCode")]
protected static extern void AddressSetPostalCode64(IntPtr pAddress, string strPostalCode);
protected static void AddressSetPostalCode(IntPtr pAddress, string strPostalCode)
{
if (IntPtr.Size * 8 == 32)
AddressSetPostalCode32(pAddress, strPostalCode);
else
AddressSetPostalCode64(pAddress, strPostalCode);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressSetCountry")]
protected static extern void AddressSetCountry32(IntPtr pAddress, string strCountry);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "AddressSetCountry")]
protected static extern void AddressSetCountry64(IntPtr pAddress, string strCountry);
protected static void AddressSetCountry(IntPtr pAddress, string strCountry)
{
if (IntPtr.Size * 8 == 32)
AddressSetCountry32(pAddress, strCountry);
else
AddressSetCountry64(pAddress, strCountry);
}
#endregion
#region MAPIFolder DLLCalls
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetHierarchy")]
protected static extern bool FolderGetHierarchy32(IntPtr pFolder);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetHierarchy")]
protected static extern bool FolderGetHierarchy64(IntPtr pFolder);
protected static bool FolderGetHierarchy(IntPtr pFolder)
{
if (IntPtr.Size * 8 == 32)
return FolderGetHierarchy32(pFolder);
else
return FolderGetHierarchy64(pFolder);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderOpenSubFolder")]
protected static extern IntPtr FolderOpenSubFolder32(IntPtr pFolder, string strSubFolder);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderOpenSubFolder")]
protected static extern IntPtr FolderOpenSubFolder64(IntPtr pFolder, string strSubFolder);
protected static IntPtr FolderOpenSubFolder(IntPtr pFolder, string strSubFolder)
{
if (IntPtr.Size * 8 == 32)
return FolderOpenSubFolder32(pFolder, strSubFolder);
else
return FolderOpenSubFolder64(pFolder, strSubFolder);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderCreateSubFolder")]
protected static extern IntPtr FolderCreateSubFolder32(IntPtr pFolder, string strSubFolder);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderCreateSubFolder")]
protected static extern IntPtr FolderCreateSubFolder64(IntPtr pFolder, string strSubFolder);
protected static IntPtr FolderCreateSubFolder(IntPtr pFolder, string strSubFolder)
{
if (IntPtr.Size * 8 == 32)
return FolderCreateSubFolder32(pFolder, strSubFolder);
else
return FolderCreateSubFolder64(pFolder, strSubFolder);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderDeleteSubFolderByName")]
protected static extern bool FolderDeleteSubFolderByName32(IntPtr pFolder, string strSubFolder);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderDeleteSubFolderByName")]
protected static extern bool FolderDeleteSubFolderByName64(IntPtr pFolder, string strSubFolder);
protected static bool FolderDeleteSubFolderByName(IntPtr pFolder, string strSubFolder)
{
if (IntPtr.Size * 8 == 32)
return FolderDeleteSubFolderByName32(pFolder, strSubFolder);
else
return FolderDeleteSubFolderByName64(pFolder, strSubFolder);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderDeleteSubFolder")]
protected static extern bool FolderDeleteSubFolder32(IntPtr pFolder, IntPtr pSubFolder);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderDeleteSubFolder")]
protected static extern bool FolderDeleteSubFolder64(IntPtr pFolder, IntPtr pSubFolder);
protected static bool FolderDeleteSubFolder(IntPtr pFolder, IntPtr pSubFolder)
{
if (IntPtr.Size * 8 == 32)
return FolderDeleteSubFolder32(pFolder, pSubFolder);
else
return FolderDeleteSubFolder64(pFolder, pSubFolder);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetContents")]
protected static extern bool FolderGetContents32(IntPtr pFolder);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetContents")]
protected static extern bool FolderGetContents64(IntPtr pFolder);
protected static bool FolderGetContents(IntPtr pFolder)
{
if (IntPtr.Size * 8 == 32)
return FolderGetContents32(pFolder);
else
return FolderGetContents64(pFolder);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetRowCount")]
protected static extern int FolderGetRowCount32(IntPtr pFolder);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetRowCount")]
protected static extern int FolderGetRowCount64(IntPtr pFolder);
protected static int FolderGetRowCount(IntPtr pFolder)
{
if (IntPtr.Size * 8 == 32)
return FolderGetRowCount32(pFolder);
else
return FolderGetRowCount64(pFolder);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderSortContents")]
protected static extern bool FolderSortContents32(IntPtr pFolder, bool bAscending, int nSortField);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderSortContents")]
protected static extern bool FolderSortContents64(IntPtr pFolder, bool bAscending, int nSortField);
protected static bool FolderSortContents(IntPtr pFolder, bool bAscending, int nSortField)
{
if (IntPtr.Size * 8 == 32)
return FolderSortContents32(pFolder, bAscending, nSortField);
else
return FolderSortContents64(pFolder, bAscending, nSortField);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderSetUnreadOnly")]
protected static extern bool FolderSetUnreadOnly32(IntPtr pFolder, bool bUnreadOnly);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderSetUnreadOnly")]
protected static extern bool FolderSetUnreadOnly64(IntPtr pFolder, bool bUnreadOnly);
protected static bool FolderSetUnreadOnly(IntPtr pFolder, bool bUnreadOnly)
{
if (IntPtr.Size * 8 == 32)
return FolderSetUnreadOnly32(pFolder, bUnreadOnly);
else
return FolderSetUnreadOnly64(pFolder, bUnreadOnly);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetNextMessage")]
protected static extern bool FolderGetNextMessage32(IntPtr pFolder, out IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetNextMessage")]
protected static extern bool FolderGetNextMessage64(IntPtr pFolder, out IntPtr pMessage);
protected static bool FolderGetNextMessage(IntPtr pFolder, out IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return FolderGetNextMessage32(pFolder, out pMessage);
else
return FolderGetNextMessage64(pFolder, out pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetNextContact")]
protected static extern bool FolderGetNextContact32(IntPtr pFolder, out IntPtr pContact);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetNextContact")]
protected static extern bool FolderGetNextContact64(IntPtr pFolder, out IntPtr pContact);
protected static bool FolderGetNextContact(IntPtr pFolder, out IntPtr pContact)
{
if (IntPtr.Size * 8 == 32)
return FolderGetNextContact32(pFolder, out pContact);
else
return FolderGetNextContact64(pFolder, out pContact);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetNextAppointment")]
protected static extern bool FolderGetNextAppointment32(IntPtr pFolder, out IntPtr pAppointment);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetNextAppointment")]
protected static extern bool FolderGetNextAppointment64(IntPtr pFolder, out IntPtr pAppointment);
protected static bool FolderGetNextAppointment(IntPtr pFolder, out IntPtr pAppointment)
{
if (IntPtr.Size * 8 == 32)
return FolderGetNextAppointment32(pFolder, out pAppointment);
else
return FolderGetNextAppointment64(pFolder, out pAppointment);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetNextSubFolder")]
protected static extern bool FolderGetNextSubFolder32(IntPtr pFolder, out IntPtr pSubFolder, StringBuilder strFolder, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderGetNextSubFolder")]
protected static extern bool FolderGetNextSubFolder64(IntPtr pFolder, out IntPtr pSubFolder, StringBuilder strFolder, int nMaxLength);
protected static bool FolderGetNextSubFolder(IntPtr pFolder, out IntPtr pSubFolder, StringBuilder strFolder, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return FolderGetNextSubFolder32(pFolder, out pSubFolder, strFolder, nMaxLength);
else
return FolderGetNextSubFolder64(pFolder, out pSubFolder, strFolder, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderDeleteMessage")]
protected static extern bool FolderDeleteMessage32(IntPtr pFolder, IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderDeleteMessage")]
protected static extern bool FolderDeleteMessage64(IntPtr pFolder, IntPtr pMessage);
protected static bool FolderDeleteMessage(IntPtr pFolder, IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return FolderDeleteMessage32(pFolder, pMessage);
else
return FolderDeleteMessage64(pFolder, pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderCopyMessage")]
protected static extern bool FolderCopyMessage32(IntPtr pFolder, IntPtr pMessage, IntPtr pFolderDest);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderCopyMessage")]
protected static extern bool FolderCopyMessage64(IntPtr pFolder, IntPtr pMessage, IntPtr pFolderDest);
protected static bool FolderCopyMessage(IntPtr pFolder, IntPtr pMessage, IntPtr pFolderDest)
{
if (IntPtr.Size * 8 == 32)
return FolderCopyMessage32(pFolder, pMessage, pFolderDest);
else
return FolderCopyMessage64(pFolder, pMessage, pFolderDest);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderMoveMessage")]
protected static extern bool FolderMoveMessage32(IntPtr pFolder, IntPtr pMessage, IntPtr pFolderDest);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderMoveMessage")]
protected static extern bool FolderMoveMessage64(IntPtr pFolder, IntPtr pMessage, IntPtr pFolderDest);
protected static bool FolderMoveMessage(IntPtr pFolder, IntPtr pMessage, IntPtr pFolderDest)
{
if (IntPtr.Size * 8 == 32)
return FolderMoveMessage32(pFolder, pMessage, pFolderDest);
else
return FolderMoveMessage64(pFolder, pMessage, pFolderDest);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderDeleteContact")]
protected static extern bool FolderDeleteContact32(IntPtr pFolder, IntPtr pContact);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderDeleteContact")]
protected static extern bool FolderDeleteContact64(IntPtr pFolder, IntPtr pContact);
protected static bool FolderDeleteContact(IntPtr pFolder, IntPtr pContact)
{
if (IntPtr.Size * 8 == 32)
return FolderDeleteContact32(pFolder, pContact);
else
return FolderDeleteContact64(pFolder, pContact);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderDeleteAppointment")]
protected static extern bool FolderDeleteAppointment32(IntPtr pFolder, IntPtr pAppointment);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "FolderDeleteAppointment")]
protected static extern bool FolderDeleteAppointment64(IntPtr pFolder, IntPtr pAppointment);
protected static bool FolderDeleteAppointment(IntPtr pFolder, IntPtr pAppointment)
{
if (IntPtr.Size * 8 == 32)
return FolderDeleteAppointment32(pFolder, pAppointment);
else
return FolderDeleteAppointment64(pFolder, pAppointment);
}
#endregion
#region MAPIMessage DLLCalls
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageCreate")]
protected static extern bool MessageCreate32(IntPtr pMAPI, out IntPtr pMessage, int nImportance, bool bSaveToSentFolder, IntPtr pFolder);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageCreate")]
protected static extern bool MessageCreate64(IntPtr pMAPI, out IntPtr pMessage, int nImportance, bool bSaveToSentFolder, IntPtr pFolder);
protected static bool MessageCreate(IntPtr pMAPI, out IntPtr pMessage, int nImportance, bool bSaveToSentFolder, IntPtr pFolder)
{
if (IntPtr.Size * 8 == 32)
return MessageCreate32(pMAPI, out pMessage, nImportance, bSaveToSentFolder, pFolder);
else
return MessageCreate64(pMAPI, out pMessage, nImportance, bSaveToSentFolder, pFolder);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSend")]
protected static extern bool MessageSend32(IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSend")]
protected static extern bool MessageSend64(IntPtr pMessage);
protected static bool MessageSend(IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return MessageSend32(pMessage);
else
return MessageSend64(pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageShowForm")]
protected static extern int MessageShowForm32(IntPtr pMAPI, IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageShowForm")]
protected static extern int MessageShowForm64(IntPtr pMAPI, IntPtr pMessage);
protected static int MessageShowForm(IntPtr pMAPI, IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return MessageShowForm32(pMAPI, pMessage);
else
return MessageShowForm64(pMAPI, pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageIsUnread")]
protected static extern bool MessageIsUnread32(IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageIsUnread")]
protected static extern bool MessageIsUnread64(IntPtr pMessage);
protected static bool MessageIsUnread(IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return MessageIsUnread32(pMessage);
else
return MessageIsUnread64(pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageMarkAsRead")]
protected static extern bool MessageMarkAsRead32(IntPtr pMessage, bool bRead);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageMarkAsRead")]
protected static extern bool MessageMarkAsRead64(IntPtr pMessage, bool bRead);
protected static bool MessageMarkAsRead(IntPtr pMessage, bool bRead)
{
if (IntPtr.Size * 8 == 32)
return MessageMarkAsRead32(pMessage, bRead);
else
return MessageMarkAsRead64(pMessage, bRead);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetHeader")]
protected static extern bool MessageGetHeader32(IntPtr pMessage, StringBuilder strHeader, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetHeader")]
protected static extern bool MessageGetHeader64(IntPtr pMessage, StringBuilder strHeader, int nMaxLength);
protected static bool MessageGetHeader(IntPtr pMessage, StringBuilder strHeader, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return MessageGetHeader32(pMessage, strHeader, nMaxLength);
else
return MessageGetHeader64(pMessage, strHeader, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSenderName")]
protected static extern void MessageGetSenderName32(IntPtr pMessage, StringBuilder strSenderName, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSenderName")]
protected static extern void MessageGetSenderName64(IntPtr pMessage, StringBuilder strSenderName, int nMaxLength);
protected static void MessageGetSenderName(IntPtr pMessage, StringBuilder strSenderName, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
MessageGetSenderName32(pMessage, strSenderName, nMaxLength);
else
MessageGetSenderName64(pMessage, strSenderName, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSenderEmail")]
protected static extern void MessageGetSenderEmail32(IntPtr pMessage, StringBuilder strSenderEmail, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSenderEmail")]
protected static extern void MessageGetSenderEmail64(IntPtr pMessage, StringBuilder strSenderEmail, int nMaxLength);
protected static void MessageGetSenderEmail(IntPtr pMessage, StringBuilder strSenderEmail, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
MessageGetSenderEmail32(pMessage, strSenderEmail, nMaxLength);
else
MessageGetSenderEmail64(pMessage, strSenderEmail, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSubject")]
protected static extern void MessageGetSubject32(IntPtr pMessage, StringBuilder strSubject, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSubject")]
protected static extern void MessageGetSubject64(IntPtr pMessage, StringBuilder strSubject, int nMaxLength);
protected static void MessageGetSubject(IntPtr pMessage, StringBuilder strSubject, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
MessageGetSubject32(pMessage, strSubject, nMaxLength);
else
MessageGetSubject64(pMessage, strSubject, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetReceivedTime")]
protected static extern bool MessageGetReceivedTime32(IntPtr pMessage, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetReceivedTime")]
protected static extern bool MessageGetReceivedTime64(IntPtr pMessage, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond);
protected static bool MessageGetReceivedTime(IntPtr pMessage, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond)
{
if (IntPtr.Size * 8 == 32)
return MessageGetReceivedTime32(pMessage, out nYear, out nMonth, out nDay, out nHour, out nMinute, out nSecond);
else
return MessageGetReceivedTime64(pMessage, out nYear, out nMonth, out nDay, out nHour, out nMinute, out nSecond);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetReceivedTimeString")]
protected static extern bool MessageGetReceivedTimeString32(IntPtr pMessage, StringBuilder strReceivedTime, int nMaxLength, string szFormat);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetReceivedTimeString")]
protected static extern bool MessageGetReceivedTimeString64(IntPtr pMessage, StringBuilder strReceivedTime, int nMaxLength, string szFormat);
protected static bool MessageGetReceivedTimeString(IntPtr pMessage, StringBuilder strReceivedTime, int nMaxLength, string szFormat)
{
if (IntPtr.Size * 8 == 32)
return MessageGetReceivedTimeString32(pMessage, strReceivedTime, nMaxLength, szFormat);
else
return MessageGetReceivedTimeString64(pMessage, strReceivedTime, nMaxLength, szFormat);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSubmitTime")]
protected static extern bool MessageGetSubmitTime32(IntPtr pMessage, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSubmitTime")]
protected static extern bool MessageGetSubmitTime64(IntPtr pMessage, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond);
protected static bool MessageGetSubmitTime(IntPtr pMessage, out int nYear, out int nMonth, out int nDay, out int nHour, out int nMinute, out int nSecond)
{
if (IntPtr.Size * 8 == 32)
return MessageGetSubmitTime32(pMessage, out nYear, out nMonth, out nDay, out nHour, out nMinute, out nSecond);
else
return MessageGetSubmitTime64(pMessage, out nYear, out nMonth, out nDay, out nHour, out nMinute, out nSecond);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSubmitTimeString")]
protected static extern bool MessageGetSubmitTimeString32(IntPtr pMessage, StringBuilder strSubmitTime, int nMaxLength, string szFormat);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSubmitTimeString")]
protected static extern bool MessageGetSubmitTimeString64(IntPtr pMessage, StringBuilder strSubmitTime, int nMaxLength, string szFormat);
protected static bool MessageGetSubmitTimeString(IntPtr pMessage, StringBuilder strSubmitTime, int nMaxLength, string szFormat)
{
if (IntPtr.Size * 8 == 32)
return MessageGetSubmitTimeString32(pMessage, strSubmitTime, nMaxLength, szFormat);
else
return MessageGetSubmitTimeString64(pMessage, strSubmitTime, nMaxLength, szFormat);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetTo")]
protected static extern bool MessageGetTo32(IntPtr pMessage, StringBuilder strTo, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetTo")]
protected static extern bool MessageGetTo64(IntPtr pMessage, StringBuilder strTo, int nMaxLength);
protected static bool MessageGetTo(IntPtr pMessage, StringBuilder strTo, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return MessageGetTo32(pMessage, strTo, nMaxLength);
else
return MessageGetTo64(pMessage, strTo, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetCC")]
protected static extern bool MessageGetCC32(IntPtr pMessage, StringBuilder strCC, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetCC")]
protected static extern bool MessageGetCC64(IntPtr pMessage, StringBuilder strCC, int nMaxLength);
protected static bool MessageGetCC(IntPtr pMessage, StringBuilder strCC, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return MessageGetCC32(pMessage, strCC, nMaxLength);
else
return MessageGetCC64(pMessage, strCC, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetBCC")]
protected static extern bool MessageGetBCC32(IntPtr pMessage, StringBuilder strBCC, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetBCC")]
protected static extern bool MessageGetBCC64(IntPtr pMessage, StringBuilder strBCC, int nMaxLength);
protected static bool MessageGetBCC(IntPtr pMessage, StringBuilder strBCC, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return MessageGetBCC32(pMessage, strBCC, nMaxLength);
else
return MessageGetBCC64(pMessage, strBCC, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSensitivity")]
protected static extern int MessageGetSensitivity32(IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetSensitivity")]
protected static extern int MessageGetSensitivity64(IntPtr pMessage);
protected static int MessageGetSensitivity(IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return MessageGetSensitivity32(pMessage);
else
return MessageGetSensitivity64(pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetPriority")]
protected static extern int MessageGetPriority32(IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetPriority")]
protected static extern int MessageGetPriority64(IntPtr pMessage);
protected static int MessageGetPriority(IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return MessageGetPriority32(pMessage);
else
return MessageGetPriority64(pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetImportance")]
protected static extern int MessageGetImportance32(IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetImportance")]
protected static extern int MessageGetImportance64(IntPtr pMessage);
protected static int MessageGetImportance(IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return MessageGetImportance32(pMessage);
else
return MessageGetImportance64(pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetRecipients")]
protected static extern bool MessageGetRecipients32(IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetRecipients")]
protected static extern bool MessageGetRecipients64(IntPtr pMessage);
protected static bool MessageGetRecipients(IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return MessageGetRecipients32(pMessage);
else
return MessageGetRecipients64(pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetNextRecipient")]
protected static extern bool MessageGetNextRecipient32(IntPtr pMessage, StringBuilder strName, int nMaxLenName, StringBuilder strEmail, int nMaxLenEmail, out int nType);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetNextRecipient")]
protected static extern bool MessageGetNextRecipient64(IntPtr pMessage, StringBuilder strName, int nMaxLenName, StringBuilder strEmail, int nMaxLenEmail, out int nType);
protected static bool MessageGetNextRecipient(IntPtr pMessage, StringBuilder strName, int nMaxLenName, StringBuilder strEmail, int nMaxLenEmail, out int nType)
{
if (IntPtr.Size * 8 == 32)
return MessageGetNextRecipient32(pMessage, strName, nMaxLenEmail, strEmail, nMaxLenEmail, out nType);
else
return MessageGetNextRecipient64(pMessage, strName, nMaxLenEmail, strEmail, nMaxLenEmail, out nType);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetReplyTo")]
protected static extern bool MessageGetReplyTo32(IntPtr pMessage, StringBuilder strEmail, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetReplyTo")]
protected static extern bool MessageGetReplyTo64(IntPtr pMessage, StringBuilder strEmail, int nMaxLength);
protected static bool MessageGetReplyTo(IntPtr pMessage, StringBuilder strEmail, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return MessageGetReplyTo32(pMessage, strEmail, nMaxLength);
else
return MessageGetReplyTo64(pMessage, strEmail, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetAttachmentCount")]
protected static extern int MessageGetAttachmentCount32(IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetAttachmentCount")]
protected static extern int MessageGetAttachmentCount64(IntPtr pMessage);
protected static int MessageGetAttachmentCount(IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return MessageGetAttachmentCount32(pMessage);
else
return MessageGetAttachmentCount64(pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetAttachmentCID")]
protected static extern bool MessageGetAttachmentCID32(IntPtr pMessage, StringBuilder strAttachmentCID, int nMaxLength, int nIndex);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetAttachmentCID")]
protected static extern bool MessageGetAttachmentCID64(IntPtr pMessage, StringBuilder strAttachmentCID, int nMaxLength, int nIndex);
protected static bool MessageGetAttachmentCID(IntPtr pMessage, StringBuilder strAttachmentCID, int nMaxLength, int nIndex)
{
if (IntPtr.Size * 8 == 32)
return MessageGetAttachmentCID32(pMessage, strAttachmentCID, nMaxLength, nIndex);
else
return MessageGetAttachmentCID64(pMessage, strAttachmentCID, nMaxLength, nIndex);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetAttachmentName")]
protected static extern bool MessageGetAttachmentName32(IntPtr pMessage, StringBuilder strAttachmentName, int nMaxLength, int nIndex);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageGetAttachmentName")]
protected static extern bool MessageGetAttachmentName64(IntPtr pMessage, StringBuilder strAttachmentName, int nMaxLength, int nIndex);
protected static bool MessageGetAttachmentName(IntPtr pMessage, StringBuilder strAttachmentName, int nMaxLength, int nIndex)
{
if (IntPtr.Size * 8 == 32)
return MessageGetAttachmentName32(pMessage, strAttachmentName, nMaxLength, nIndex);
else
return MessageGetAttachmentName64(pMessage, strAttachmentName, nMaxLength, nIndex);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSaveAttachment")]
protected static extern bool MessageSaveAttachment32(IntPtr pMessage, string strFolder, int nIndex);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSaveAttachment")]
protected static extern bool MessageSaveAttachment64(IntPtr pMessage, string strFolder, int nIndex);
protected static bool MessageSaveAttachment(IntPtr pMessage, string strFolder, int nIndex)
{
if (IntPtr.Size * 8 == 32)
return MessageSaveAttachment32(pMessage, strFolder, nIndex);
else
return MessageSaveAttachment64(pMessage, strFolder, nIndex);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageDeleteAttachment")]
protected static extern bool MessageDeleteAttachment32(IntPtr pMessage, int nIndex);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageDeleteAttachment")]
protected static extern bool MessageDeleteAttachment64(IntPtr pMessage, int nIndex);
protected static bool MessageDeleteAttachment(IntPtr pMessage, int nIndex)
{
if (IntPtr.Size * 8 == 32)
return MessageDeleteAttachment32(pMessage, nIndex);
else
return MessageDeleteAttachment64(pMessage, nIndex);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetMessageStatus")]
protected static extern bool MessageSetMessageStatus32(IntPtr pMessage, int nMessageStatus);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetMessageStatus")]
protected static extern bool MessageSetMessageStatus64(IntPtr pMessage, int nMessageStatus);
protected static bool MessageSetMessageStatus(IntPtr pMessage, int nMessageStatus)
{
if (IntPtr.Size * 8 == 32)
return MessageSetMessageStatus32(pMessage, nMessageStatus);
else
return MessageSetMessageStatus64(pMessage, nMessageStatus);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageAddRecipient")]
protected static extern bool MessageAddRecipient32(IntPtr pMessage, string strEmail, int nType, string strAddrType);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageAddRecipient")]
protected static extern bool MessageAddRecipient64(IntPtr pMessage, string strEmail, int nType, string strAddrType);
protected static bool MessageAddRecipient(IntPtr pMessage, string strEmail, int nType, string strAddrType)
{
if (IntPtr.Size * 8 == 32)
return MessageAddRecipient32(pMessage, strEmail, nType, strAddrType);
else
return MessageAddRecipient64(pMessage, strEmail, nType, strAddrType);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetSubject")]
protected static extern void MessageSetSubject32(IntPtr pMessage, string strSubject);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetSubject")]
protected static extern void MessageSetSubject64(IntPtr pMessage, string strSubject);
protected static void MessageSetSubject(IntPtr pMessage, string strSubject)
{
if (IntPtr.Size * 8 == 32)
MessageSetSubject32(pMessage, strSubject);
else
MessageSetSubject64(pMessage, strSubject);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetSender")]
protected static extern void MessageSetSender32(IntPtr pMessage, string strSenderName, string strSenderEmail);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetSender")]
protected static extern void MessageSetSender64(IntPtr pMessage, string strSenderName, string strSenderEmail);
protected static void MessageSetSender(IntPtr pMessage, string strSenderName, string strSenderEmail)
{
if (IntPtr.Size * 8 == 32)
MessageSetSender32(pMessage, strSenderName, strSenderEmail);
else
MessageSetSender64(pMessage, strSenderName, strSenderEmail);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetReceivedTime")]
protected static extern bool MessageSetReceivedTime32(IntPtr pMessage, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond, bool bLocal);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetReceivedTime")]
protected static extern bool MessageSetReceivedTime64(IntPtr pMessage, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond, bool bLocal);
protected static bool MessageSetReceivedTime(IntPtr pMessage, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond, bool bLocal)
{
if (IntPtr.Size * 8 == 32)
return MessageSetReceivedTime32(pMessage, nYear, nMonth, nDay, nHour, nMinute, nSecond, bLocal);
else
return MessageSetReceivedTime64(pMessage, nYear, nMonth, nDay, nHour, nMinute, nSecond, bLocal);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetSubmitTime")]
protected static extern bool MessageSetSubmitTime32(IntPtr pMessage, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond, bool bLocal);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetSubmitTime")]
protected static extern bool MessageSetSubmitTime64(IntPtr pMessage, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond, bool bLocal);
protected static bool MessageSetSubmitTime(IntPtr pMessage, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond, bool bLocal)
{
if (IntPtr.Size * 8 == 32)
return MessageSetSubmitTime32(pMessage, nYear, nMonth, nDay, nHour, nMinute, nSecond, bLocal);
else
return MessageSetSubmitTime64(pMessage, nYear, nMonth, nDay, nHour, nMinute, nSecond, bLocal);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageAddAttachment")]
protected static extern bool MessageAddAttachment32(IntPtr pMessage, string strPath, string strName, string strCID);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageAddAttachment")]
protected static extern bool MessageAddAttachment64(IntPtr pMessage, string strPath, string strName, string strCID);
protected static bool MessageAddAttachment(IntPtr pMessage, string strPath, string strName, string strCID)
{
if (IntPtr.Size * 8 == 32)
return MessageAddAttachment32(pMessage, strPath, strName, strCID);
else
return MessageAddAttachment64(pMessage, strPath, strName, strCID);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetReadReceipt")]
protected static extern bool MessageSetReadReceipt32(IntPtr pMessage, bool bSet, string strReceiverEmail);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetReadReceipt")]
protected static extern bool MessageSetReadReceipt64(IntPtr pMessage, bool bSet, string strReceiverEmail);
protected static bool MessageSetReadReceipt(IntPtr pMessage, bool bSet, string strReceiverEmail)
{
if (IntPtr.Size * 8 == 32)
return MessageSetReadReceipt32(pMessage, bSet, strReceiverEmail);
else
return MessageSetReadReceipt64(pMessage, bSet, strReceiverEmail);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetDeliveryReceipt")]
protected static extern bool MessageSetDeliveryReceipt32(IntPtr pMessage, bool bSet);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetDeliveryReceipt")]
protected static extern bool MessageSetDeliveryReceipt64(IntPtr pMessage, bool bSet);
protected static bool MessageSetDeliveryReceipt(IntPtr pMessage, bool bSet)
{
if (IntPtr.Size * 8 == 32)
return MessageSetDeliveryReceipt32(pMessage, bSet);
else
return MessageSetDeliveryReceipt64(pMessage, bSet);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageMarkAsPrivate")]
protected static extern bool MessageMarkAsPrivate32(IntPtr pMessage);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageMarkAsPrivate")]
protected static extern bool MessageMarkAsPrivate64(IntPtr pMessage);
protected static bool MessageMarkAsPrivate(IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return MessageMarkAsPrivate32(pMessage);
else
return MessageMarkAsPrivate64(pMessage);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetSensitivity")]
protected static extern bool MessageSetSensitivity32(IntPtr pMessage, int nSensitivity);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "MessageSetSensitivity")]
protected static extern bool MessageSetSensitivity64(IntPtr pMessage, int nSensitivity);
protected static bool MessageSetSensitivity(IntPtr pMessage, int nSensitivity)
{
if (IntPtr.Size * 8 == 32)
return MessageSetSensitivity32(pMessage, nSensitivity);
else
return MessageSetSensitivity64(pMessage, nSensitivity);
}
#endregion
#region MAPIObject DLLCalls
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectClose")]
protected static extern void ObjectClose32(IntPtr pObject);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectClose")]
protected static extern void ObjectClose64(IntPtr pObject);
protected static void ObjectClose(IntPtr pObject)
{
if (IntPtr.Size * 8 == 32)
ObjectClose32(pObject);
else
ObjectClose64(pObject);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSave")]
protected static extern bool ObjectSave32(IntPtr pObject, bool bClose);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSave")]
protected static extern bool ObjectSave64(IntPtr pObject, bool bClose);
protected static bool ObjectSave(IntPtr pObject, bool bClose)
{
if (IntPtr.Size * 8 == 32)
return ObjectSave32(pObject, bClose);
else
return ObjectSave64(pObject, bClose);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetMessageFlags")]
protected static extern int ObjectGetMessageFlags32(IntPtr pObject);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetMessageFlags")]
protected static extern int ObjectGetMessageFlags64(IntPtr pObject);
protected static int ObjectGetMessageFlags(IntPtr pObject)
{
if (IntPtr.Size * 8 == 32)
return ObjectGetMessageFlags32(pObject);
else
return ObjectGetMessageFlags64(pObject);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetEntryID")]
protected static extern bool ObjectGetEntryID32(IntPtr pObject, StringBuilder strEntryID, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetEntryID")]
protected static extern bool ObjectGetEntryID64(IntPtr pObject, StringBuilder strEntryID, int nMaxLength);
protected static bool ObjectGetEntryID(IntPtr pObject, StringBuilder strEntryID, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ObjectGetEntryID32(pObject, strEntryID, nMaxLength);
else
return ObjectGetEntryID64(pObject, strEntryID, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetMessageClass")]
protected static extern bool ObjectGetMessageClass32(IntPtr pObject, StringBuilder szMessageClass, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetMessageClass")]
protected static extern bool ObjectGetMessageClass64(IntPtr pObject, StringBuilder szMessageClass, int nMaxLength);
protected static bool ObjectGetMessageClass(IntPtr pObject, StringBuilder szMessageClass, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ObjectGetMessageClass32(pObject, szMessageClass, nMaxLength);
else
return ObjectGetMessageClass64(pObject, szMessageClass, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetMessageEditorFormat")]
protected static extern int ObjectGetMessageEditorFormat32(IntPtr pObject);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetMessageEditorFormat")]
protected static extern int ObjectGetMessageEditorFormat64(IntPtr pObject);
protected static int ObjectGetMessageEditorFormat(IntPtr pObject)
{
if (IntPtr.Size * 8 == 32)
return ObjectGetMessageEditorFormat32(pObject);
else
return ObjectGetMessageEditorFormat64(pObject);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetPropertyString")]
protected static extern bool ObjectGetPropertyString32(IntPtr pObject, uint ulProperty, StringBuilder strProperty, int nMaxLength, bool bStream);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetPropertyString")]
protected static extern bool ObjectGetPropertyString64(IntPtr pObject, uint ulProperty, StringBuilder strProperty, int nMaxLength, bool bStream);
protected static bool ObjectGetPropertyString(IntPtr pObject, uint ulProperty, StringBuilder strProperty, int nMaxLength, bool bStream)
{
if (IntPtr.Size * 8 == 32)
return ObjectGetPropertyString32(pObject, ulProperty, strProperty, nMaxLength, bStream);
else
return ObjectGetPropertyString64(pObject, ulProperty, strProperty, nMaxLength, bStream);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetNamedProperty")]
protected static extern bool ObjectGetNamedProperty32(IntPtr pObject, string strFieldName, StringBuilder strField, int nMaxLength);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetNamedProperty")]
protected static extern bool ObjectGetNamedProperty64(IntPtr pObject, string strFieldName, StringBuilder strField, int nMaxLength);
protected static bool ObjectGetNamedProperty(IntPtr pObject, string strFieldName, StringBuilder strField, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return ObjectGetNamedProperty32(pObject, strFieldName, strField, nMaxLength);
else
return ObjectGetNamedProperty64(pObject, strFieldName, strField, nMaxLength);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetBody")]
protected static extern bool ObjectGetBody32(IntPtr pObject, out IntPtr szBody, bool bAutoDetect);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetBody")]
protected static extern bool ObjectGetBody64(IntPtr pObject, out IntPtr szBody, bool bAutoDetect);
protected static bool ObjectGetBody(IntPtr pObject, out IntPtr szBody, bool bAutoDetect)
{
if (IntPtr.Size * 8 == 32)
return ObjectGetBody32(pObject, out szBody, bAutoDetect);
else
return ObjectGetBody64(pObject, out szBody, bAutoDetect);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetHTML")]
protected static extern bool ObjectGetHTML32(IntPtr pObject, out IntPtr szHTML);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetHTML")]
protected static extern bool ObjectGetHTML64(IntPtr pObject, out IntPtr szHTML);
protected static bool ObjectGetHTML(IntPtr pObject, out IntPtr szHTML)
{
if (IntPtr.Size * 8 == 32)
return ObjectGetHTML32(pObject, out szHTML);
else
return ObjectGetHTML64(pObject, out szHTML);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetRTF")]
protected static extern bool ObjectGetRTF32(IntPtr pObject, out IntPtr szRTF);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectGetRTF")]
protected static extern bool ObjectGetRTF64(IntPtr pObject, out IntPtr szRTF);
protected static bool ObjectGetRTF(IntPtr pObject, out IntPtr szRTF)
{
if (IntPtr.Size * 8 == 32)
return ObjectGetRTF32(pObject, out szRTF);
else
return ObjectGetRTF64(pObject, out szRTF);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectFreeBody")]
protected static extern void ObjectFreeBody32();
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectFreeBody")]
protected static extern void ObjectFreeBody64();
protected static void ObjectFreeBody()
{
if (IntPtr.Size * 8 == 32)
ObjectFreeBody32();
else
ObjectFreeBody64();
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetMessageFlags")]
protected static extern bool ObjectSetMessageFlags32(IntPtr pObject, int nFlags);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetMessageFlags")]
protected static extern bool ObjectSetMessageFlags64(IntPtr pObject, int nFlags);
protected static bool ObjectSetMessageFlags(IntPtr pObject, int nFlags)
{
if (IntPtr.Size * 8 == 32)
return ObjectSetMessageFlags32(pObject, nFlags);
else
return ObjectSetMessageFlags64(pObject, nFlags);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetMessageEditorFormat")]
protected static extern bool ObjectSetMessageEditorFormat32(IntPtr pObject, int nFormat);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetMessageEditorFormat")]
protected static extern bool ObjectSetMessageEditorFormat64(IntPtr pObject, int nFormat);
protected static bool ObjectSetMessageEditorFormat(IntPtr pObject, int nFormat)
{
if (IntPtr.Size * 8 == 32)
return ObjectSetMessageEditorFormat32(pObject, nFormat);
else
return ObjectSetMessageEditorFormat64(pObject, nFormat);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetPropertyString")]
protected static extern bool ObjectSetPropertyString32(IntPtr pObject, uint ulProperty, string strProperty, bool bStream);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetPropertyString")]
protected static extern bool ObjectSetPropertyString64(IntPtr pObject, uint ulProperty, string strProperty, bool bStream);
protected static bool ObjectSetPropertyString(IntPtr pObject, uint ulProperty, string strProperty, bool bStream)
{
if (IntPtr.Size * 8 == 32)
return ObjectSetPropertyString32(pObject, ulProperty, strProperty, bStream);
else
return ObjectSetPropertyString64(pObject, ulProperty, strProperty, bStream);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetNamedProperty")]
protected static extern bool ObjectSetNamedProperty32(IntPtr pObject, string strFieldName, string strField, bool bCreate);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetNamedProperty")]
protected static extern bool ObjectSetNamedProperty64(IntPtr pObject, string strFieldName, string strField, bool bCreate);
protected static bool ObjectSetNamedProperty(IntPtr pObject, string strFieldName, string strField, bool bCreate)
{
if (IntPtr.Size * 8 == 32)
return ObjectSetNamedProperty32(pObject, strFieldName, strField, bCreate);
else
return ObjectSetNamedProperty64(pObject, strFieldName, strField, bCreate);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetBody")]
protected static extern bool ObjectSetBody32(IntPtr pObject, string strBody);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetBody")]
protected static extern bool ObjectSetBody64(IntPtr pObject, string strBody);
protected static bool ObjectSetBody(IntPtr pObject, string strBody)
{
if (IntPtr.Size * 8 == 32)
return ObjectSetBody32(pObject, strBody);
else
return ObjectSetBody64(pObject, strBody);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetHTML")]
protected static extern bool ObjectSetHTML32(IntPtr pObject, string strHTML);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetHTML")]
protected static extern bool ObjectSetHTML64(IntPtr pObject, string strHTML);
protected static bool ObjectSetHTML(IntPtr pObject, string strHTML)
{
if (IntPtr.Size * 8 == 32)
return ObjectSetHTML32(pObject, strHTML);
else
return ObjectSetHTML64(pObject, strHTML);
}
[DllImport(NetMAPI.MAPIExDLL32, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetRTF")]
protected static extern bool ObjectSetRTF32(IntPtr pObject, string strRTF);
[DllImport(NetMAPI.MAPIExDLL64, CharSet = NetMAPI.DefaultCharSet, EntryPoint = "ObjectSetRTF")]
protected static extern bool ObjectSetRTF64(IntPtr pObject, string strRTF);
protected static bool ObjectSetRTF(IntPtr pObject, string strRTF)
{
if (IntPtr.Size * 8 == 32)
return ObjectSetRTF32(pObject, strRTF);
else
return ObjectSetRTF64(pObject, strRTF);
}
#endregion
#region NetMAPI DLLCalls
// These shouldn't be called directly by the client, use the interface in NetMAPI for this.
// Initialize and Terminate
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIInit")]
protected static extern bool MAPIInit32(bool bMultiThreadedNotifications, bool bInitAsService);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIInit")]
protected static extern bool MAPIInit64(bool bMultiThreadedNotifications, bool bInitAsService);
protected static bool MAPIInit(bool bMultiThreadedNotifications, bool bInitAsService)
{
if (IntPtr.Size * 8 == 32)
return MAPIInit32(bMultiThreadedNotifications, bInitAsService);
else
return MAPIInit64(bMultiThreadedNotifications, bInitAsService);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPITerm")]
protected static extern bool MAPITerm32();
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPITerm")]
protected static extern bool MAPITerm64();
protected static bool MAPITerm()
{
if (IntPtr.Size * 8 == 32)
return MAPITerm32();
else
return MAPITerm64();
}
// Profiles, Message Store
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPILogin")]
protected static extern IntPtr MAPILogin32(string strProfile, bool bInitAsService);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPILogin")]
protected static extern IntPtr MAPILogin64(string strProfile, bool bInitAsService);
protected static IntPtr MAPILogin(string strProfile, bool bInitAsService)
{
if (IntPtr.Size * 8 == 32)
return MAPILogin32(strProfile, bInitAsService);
else
return MAPILogin64(strProfile, bInitAsService);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPILogout")]
protected static extern void MAPILogout32(IntPtr pMAPI);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPILogout")]
protected static extern void MAPILogout64(IntPtr pMAPI);
protected static void MAPILogout(IntPtr pMAPI)
{
if (IntPtr.Size * 8 == 32)
MAPILogout32(pMAPI);
else
MAPILogout64(pMAPI);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenMessageStore")]
protected static extern bool MAPIOpenMessageStore32(IntPtr pMAPI, string strStore);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenMessageStore")]
protected static extern bool MAPIOpenMessageStore64(IntPtr pMAPI, string strStore);
protected static bool MAPIOpenMessageStore(IntPtr pMAPI, string strStore)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenMessageStore32(pMAPI, strStore);
else
return MAPIOpenMessageStore64(pMAPI, strStore);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetFolder")]
protected static extern IntPtr MAPIGetFolder32(IntPtr pMAPI);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetFolder")]
protected static extern IntPtr MAPIGetFolder64(IntPtr pMAPI);
protected static IntPtr MAPIGetFolder(IntPtr pMAPI)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetFolder32(pMAPI);
else
return MAPIGetFolder64(pMAPI);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPISetFolder")]
protected static extern IntPtr MAPISetFolder32(IntPtr pMAPI, IntPtr pFolder);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPISetFolder")]
protected static extern IntPtr MAPISetFolder64(IntPtr pMAPI, IntPtr pFolder);
protected static IntPtr MAPISetFolder(IntPtr pMAPI, IntPtr pFolder)
{
if (IntPtr.Size * 8 == 32)
return MAPISetFolder32(pMAPI, pFolder);
else
return MAPISetFolder64(pMAPI, pFolder);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetProfileName")]
protected static extern bool MAPIGetProfileName32(IntPtr pMAPI, StringBuilder strProfileName, int nMaxLength);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetProfileName")]
protected static extern bool MAPIGetProfileName64(IntPtr pMAPI, StringBuilder strProfileName, int nMaxLength);
protected static bool MAPIGetProfileName(IntPtr pMAPI, StringBuilder strProfileName, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetProfileName32(pMAPI, strProfileName, nMaxLength);
else
return MAPIGetProfileName64(pMAPI, strProfileName, nMaxLength);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetProfileEmail")]
protected static extern bool MAPIGetProfileEmail32(IntPtr pMAPI, StringBuilder strProfileEmail, int nMaxLength);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetProfileEmail")]
protected static extern bool MAPIGetProfileEmail64(IntPtr pMAPI, StringBuilder strProfileEmail, int nMaxLength);
protected static bool MAPIGetProfileEmail(IntPtr pMAPI, StringBuilder strProfileEmail, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetProfileEmail32(pMAPI, strProfileEmail, nMaxLength);
else
return MAPIGetProfileEmail64(pMAPI, strProfileEmail, nMaxLength);
}
// POOM functions
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetPOOM")]
protected static extern IntPtr MAPIGetPOOM32(IntPtr pMAPI);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetPOOM")]
protected static extern IntPtr MAPIGetPOOM64(IntPtr pMAPI);
protected static IntPtr MAPIGetPOOM(IntPtr pMAPI)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetPOOM32(pMAPI);
else
return MAPIGetPOOM64(pMAPI);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "POOMGetContents")]
protected static extern bool POOMGetContents32(IntPtr pPOOM);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "POOMGetContents")]
protected static extern bool POOMGetContents64(IntPtr pPOOM);
protected static bool POOMGetContents(IntPtr pPOOM)
{
if (IntPtr.Size * 8 == 32)
return POOMGetContents32(pPOOM);
else
return POOMGetContents64(pPOOM);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "POOMSortContents")]
protected static extern bool POOMSortContents32(IntPtr pPOOM, bool bDescending, string strSortField);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "POOMSortContents")]
protected static extern bool POOMSortContents64(IntPtr pPOOM, bool bDescending, string strSortField);
protected static bool POOMSortContents(IntPtr pPOOM, bool bDescending, string strSortField)
{
if (IntPtr.Size * 8 == 32)
return POOMSortContents32(pPOOM, bDescending, strSortField);
else
return POOMSortContents64(pPOOM, bDescending, strSortField);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "POOMGetRowCount")]
protected static extern int POOMGetRowCount32(IntPtr pPOOM);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "POOMGetRowCount")]
protected static extern int POOMGetRowCount64(IntPtr pPOOM);
protected static int POOMGetRowCount(IntPtr pPOOM)
{
if (IntPtr.Size * 8 == 32)
return POOMGetRowCount32(pPOOM);
else
return POOMGetRowCount64(pPOOM);
}
// Folders
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenFolder")]
protected static extern IntPtr MAPIOpenFolder32(IntPtr pMAPI, string folderName, bool bInternal);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenFolder")]
protected static extern IntPtr MAPIOpenFolder64(IntPtr pMAPI, string folderName, bool bInternal);
protected static IntPtr MAPIOpenFolder(IntPtr pMAPI, string folderName, bool bInternal)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenFolder32(pMAPI, folderName, bInternal);
else
return MAPIOpenFolder64(pMAPI, folderName, bInternal);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenRootFolder")]
protected static extern IntPtr MAPIOpenRootFolder32(IntPtr pMAPI, bool bInternal);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenRootFolder")]
protected static extern IntPtr MAPIOpenRootFolder64(IntPtr pMAPI, bool bInternal);
protected static IntPtr MAPIOpenRootFolder(IntPtr pMAPI, bool bInternal)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenRootFolder32(pMAPI, bInternal);
else
return MAPIOpenRootFolder64(pMAPI, bInternal);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenInbox")]
protected static extern IntPtr MAPIOpenInbox32(IntPtr pMAPI, bool bInternal);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenInbox")]
protected static extern IntPtr MAPIOpenInbox64(IntPtr pMAPI, bool bInternal);
protected static IntPtr MAPIOpenInbox(IntPtr pMAPI, bool bInternal)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenInbox32(pMAPI, bInternal);
else
return MAPIOpenInbox64(pMAPI, bInternal);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenOutbox")]
protected static extern IntPtr MAPIOpenOutbox32(IntPtr pMAPI, bool bInternal);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenOutbox")]
protected static extern IntPtr MAPIOpenOutbox64(IntPtr pMAPI, bool bInternal);
protected static IntPtr MAPIOpenOutbox(IntPtr pMAPI, bool bInternal)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenOutbox32(pMAPI, bInternal);
else
return MAPIOpenOutbox64(pMAPI, bInternal);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenSentItems")]
protected static extern IntPtr MAPIOpenSentItems32(IntPtr pMAPI, bool bInternal);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenSentItems")]
protected static extern IntPtr MAPIOpenSentItems64(IntPtr pMAPI, bool bInternal);
protected static IntPtr MAPIOpenSentItems(IntPtr pMAPI, bool bInternal)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenSentItems32(pMAPI, bInternal);
else
return MAPIOpenSentItems64(pMAPI, bInternal);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenDeletedItems")]
protected static extern IntPtr MAPIOpenDeletedItems32(IntPtr pMAPI, bool bInternal);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenDeletedItems")]
protected static extern IntPtr MAPIOpenDeletedItems64(IntPtr pMAPI, bool bInternal);
protected static IntPtr MAPIOpenDeletedItems(IntPtr pMAPI, bool bInternal)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenDeletedItems32(pMAPI, bInternal);
else
return MAPIOpenDeletedItems64(pMAPI, bInternal);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenContacts")]
protected static extern IntPtr MAPIOpenContacts32(IntPtr pMAPI, bool bInternal);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenContacts")]
protected static extern IntPtr MAPIOpenContacts64(IntPtr pMAPI, bool bInternal);
protected static IntPtr MAPIOpenContacts(IntPtr pMAPI, bool bInternal)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenContacts32(pMAPI, bInternal);
else
return MAPIOpenContacts64(pMAPI, bInternal);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenDrafts")]
protected static extern IntPtr MAPIOpenDrafts32(IntPtr pMAPI, bool bInternal);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenDrafts")]
protected static extern IntPtr MAPIOpenDrafts64(IntPtr pMAPI, bool bInternal);
protected static IntPtr MAPIOpenDrafts(IntPtr pMAPI, bool bInternal)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenDrafts32(pMAPI, bInternal);
else
return MAPIOpenDrafts64(pMAPI, bInternal);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenCalendar")]
protected static extern IntPtr MAPIOpenCalendar32(IntPtr pMAPI, bool bInternal);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenCalendar")]
protected static extern IntPtr MAPIOpenCalendar64(IntPtr pMAPI, bool bInternal);
protected static IntPtr MAPIOpenCalendar(IntPtr pMAPI, bool bInternal)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenCalendar32(pMAPI, bInternal);
else
return MAPIOpenCalendar64(pMAPI, bInternal);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenJunkFolder")]
protected static extern IntPtr MAPIOpenJunkFolder32(IntPtr pMAPI, bool bInternal);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIOpenJunkFolder")]
protected static extern IntPtr MAPIOpenJunkFolder64(IntPtr pMAPI, bool bInternal);
protected static IntPtr MAPIOpenJunkFolder(IntPtr pMAPI, bool bInternal)
{
if (IntPtr.Size * 8 == 32)
return MAPIOpenJunkFolder32(pMAPI, bInternal);
else
return MAPIOpenJunkFolder64(pMAPI, bInternal);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetHierarchy")]
protected static extern bool MAPIGetHierarchy32(IntPtr pMAPI);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetHierarchy")]
protected static extern bool MAPIGetHierarchy64(IntPtr pMAPI);
protected static bool MAPIGetHierarchy(IntPtr pMAPI)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetHierarchy32(pMAPI);
else
return MAPIGetHierarchy64(pMAPI);
}
// Messages
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetContents")]
protected static extern bool MAPIGetContents32(IntPtr pMAPI);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetContents")]
protected static extern bool MAPIGetContents64(IntPtr pMAPI);
protected static bool MAPIGetContents(IntPtr pMAPI)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetContents32(pMAPI);
else
return MAPIGetContents64(pMAPI);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetRowCount")]
protected static extern int MAPIGetRowCount32(IntPtr pMAPI);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetRowCount")]
protected static extern int MAPIGetRowCount64(IntPtr pMAPI);
protected static int MAPIGetRowCount(IntPtr pMAPI)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetRowCount32(pMAPI);
else
return MAPIGetRowCount64(pMAPI);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPISortContents")]
protected static extern bool MAPISortContents32(IntPtr pMAPI, bool bAscending, int nSortField);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPISortContents")]
protected static extern bool MAPISortContents64(IntPtr pMAPI, bool bAscending, int nSortField);
protected static bool MAPISortContents(IntPtr pMAPI, bool bAscending, int nSortField)
{
if (IntPtr.Size * 8 == 32)
return MAPISortContents32(pMAPI, bAscending, nSortField);
else
return MAPISortContents64(pMAPI, bAscending, nSortField);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPISetUnreadOnly")]
protected static extern bool MAPISetUnreadOnly32(IntPtr pMAPI, bool bUnreadOnly);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPISetUnreadOnly")]
protected static extern bool MAPISetUnreadOnly64(IntPtr pMAPI, bool bUnreadOnly);
protected static bool MAPISetUnreadOnly(IntPtr pMAPI, bool bUnreadOnly)
{
if (IntPtr.Size * 8 == 32)
return MAPISetUnreadOnly32(pMAPI, bUnreadOnly);
else
return MAPISetUnreadOnly64(pMAPI, bUnreadOnly);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetNextMessage")]
protected static extern bool MAPIGetNextMessage32(IntPtr pMAPI, out IntPtr pMessage);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetNextMessage")]
protected static extern bool MAPIGetNextMessage64(IntPtr pMAPI, out IntPtr pMessage);
protected static bool MAPIGetNextMessage(IntPtr pMAPI, out IntPtr pMessage)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetNextMessage32(pMAPI, out pMessage);
else
return MAPIGetNextMessage64(pMAPI, out pMessage);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetNextContact")]
protected static extern bool MAPIGetNextContact32(IntPtr pMAPI, out IntPtr pContact);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetNextContact")]
protected static extern bool MAPIGetNextContact64(IntPtr pMAPI, out IntPtr pContact);
protected static bool MAPIGetNextContact(IntPtr pMAPI, out IntPtr pContact)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetNextContact32(pMAPI, out pContact);
else
return MAPIGetNextContact64(pMAPI, out pContact);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetNextAppointment")]
protected static extern bool MAPIGetNextAppointment32(IntPtr pMAPI, out IntPtr pAppointment);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetNextAppointment")]
protected static extern bool MAPIGetNextAppointment64(IntPtr pMAPI, out IntPtr pAppointment);
protected static bool MAPIGetNextAppointment(IntPtr pMAPI, out IntPtr pAppointment)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetNextAppointment32(pMAPI, out pAppointment);
else
return MAPIGetNextAppointment64(pMAPI, out pAppointment);
}
[DllImport(MAPIExDLL32, CharSet = DefaultCharSet, EntryPoint = "MAPIGetNextSubFolder")]
protected static extern bool MAPIGetNextSubFolder32(IntPtr pMAPI, out IntPtr pFolder, StringBuilder strFolder, int nMaxLength);
[DllImport(MAPIExDLL64, CharSet = DefaultCharSet, EntryPoint = "MAPIGetNextSubFolder")]
protected static extern bool MAPIGetNextSubFolder64(IntPtr pMAPI, out IntPtr pFolder, StringBuilder strFolder, int nMaxLength);
protected static bool MAPIGetNextSubFolder(IntPtr pMAPI, out IntPtr pFolder, StringBuilder strFolder, int nMaxLength)
{
if (IntPtr.Size * 8 == 32)
return MAPIGetNextSubFolder32(pMAPI, out pFolder, strFolder, nMaxLength);
else
return MAPIGetNextSubFolder64(pMAPI, out pFolder, strFolder, nMaxLength);
}
#endregion
|
|
|
|
|
get only contact folder
Vijay Kumbhani
|
|
|
|
|
Use the OpenContacts function.
|
|
|
|
|
thanks buddy
Vijay Kumbhani
|
|
|
|
|
Hi Noel,
Can you please confirm me that, MAPIEx's current version is supporting for miscellaneous fields "User Field 1" to "User Field 4" of outlook contact.
Thanks,
Mayur
|
|
|
|
|
I'm not familiar with those fields but yes you can access any field including your own custom fields through the interface. Use MFCMapi or some other tool to determine the id's.
|
|
|
|
|
Ok.. Thank you.
I will look at that.
|
|
|
|
|
Hi ,
I have save all the attachments with unique filename- "searchkey-index-attachmentname".The searchkey and index are created myself. How can I get Message_ID and searchkey that is unique from MapiEx library ? And Why I can not find some keys like PR_SEARCH_ID in the project?
|
|
|
|
|
Anything not covered with helper functions can be accessed using the generic functions ie GetProperty . As for the other stuff I'm not 100% sure, you'll have to experiment.
|
|
|
|
|
Thanks a lot! I'll have an experiment!
|
|
|
|
|
First of all,Thanks a lot to the author to share the greate code!
I use it and it runs well.
But in one system, it can not login,that MAPIExLogon failed.GetLastError() code is zero. I am confused completely, and can not find the reason and problem.The environment is WinXP sp2 and MS office 2003, Russian. Looking forward to your answer!
|
|
|
|
|
You're not going to like my answer, as I have no idea! However I'd bet it was simply your MAPI provider (outlook exchange etc) isn't setup correctly. Can you see mail in outlook on the machine?
Good Luck!
|
|
|
|
|
I am very glad to get your answer.My MS outlook is setup correctly,as I can receive and send mails in outlook 2003. I have a question that the profile of outlook2003 is OUTLOOK.HOL or not.In the source mapi.Login() function has no input,the MAPILogonEx's input (-lpxaProfileName ) is also NULL,why? It can get defalt path of Profiles? Thanks a lot!
|
|
|
|
|