From e30e024786d7adf32298063dd845295850fee944 Mon Sep 17 00:00:00 2001 From: Maciej Wycik Date: Wed, 12 Feb 2014 18:11:28 +0000 Subject: MAPI requires non-unicode strings in some places. git-svn-id: http://svn.miranda-ng.org/main/trunk@8113 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Exchange/res/exchange.rc | 6 +++--- plugins/Exchange/src/MirandaExchange.cpp | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'plugins') diff --git a/plugins/Exchange/res/exchange.rc b/plugins/Exchange/res/exchange.rc index 337c167ec8..adda08baa9 100644 --- a/plugins/Exchange/res/exchange.rc +++ b/plugins/Exchange/res/exchange.rc @@ -5,7 +5,7 @@ #include #include #include -#include "src\resource.h" +#include "..\src\resource.h" @@ -60,8 +60,8 @@ FONT 8, "MS Shell Dlg", 400, 0, 1 // Icon resources // LANGUAGE LANG_NEUTRAL, SUBLANG_SYS_DEFAULT -IDI_MAIL ICON "res\\mail.ico" +IDI_MAIL ICON "..\\res\\mail.ico" LANGUAGE LANG_NEUTRAL, SUBLANG_SYS_DEFAULT -IDI_UNREAD ICON "res\\unread.ico" +IDI_UNREAD ICON "..\\res\\unread.ico" diff --git a/plugins/Exchange/src/MirandaExchange.cpp b/plugins/Exchange/src/MirandaExchange.cpp index 9f9b77881d..6589754671 100644 --- a/plugins/Exchange/src/MirandaExchange.cpp +++ b/plugins/Exchange/src/MirandaExchange.cpp @@ -469,7 +469,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass DWORD dwFlags = MAPI_EXPLICIT_PROFILE|MAPI_EXTENDED|MAPI_NEW_SESSION|MAPI_NO_MAIL ; - hr = MAPILogonEx( 0, szPIDandName, m_szPassword, dwFlags, &m_lpMAPISession ); + hr = MAPILogonEx( 0, (LPTSTR)mir_t2a(szPIDandName), (LPTSTR)mir_t2a(m_szPassword), dwFlags, &m_lpMAPISession ); if (FAILED(hr)) { //Log( _T("MAPI Logon failed: 0x%08X"), hr ); @@ -484,7 +484,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass //Log("Admin profile interface creation failed: 0x%08X", hr); } else { - hr = pProfAdmin->DeleteProfile( szPIDandName, 0 ); + hr = pProfAdmin->DeleteProfile( (LPTSTR)mir_t2a(szPIDandName), 0 ); if ( FAILED(hr) ) { //Log( "Failed to delete the profile: 0x%08X", hr ); @@ -534,7 +534,7 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName ) CMAPIInterface pMsgSvcAdmin = NULL; CMAPIInterface pMsgSvcTable = NULL; LPSRowSet pRows = NULL; - + ULONG ulFlags=0; enum {iSvcName, iSvcUID, cptaSvc}; SizedSPropTagArray(cptaSvc, sptCols) = @@ -543,20 +543,20 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName ) PR_SERVICE_NAME, PR_SERVICE_UID }; - - hr = MAPIAdminProfiles(0, &pProfAdmin); + ulFlags &= ~MAPI_UNICODE; + hr = MAPIAdminProfiles(ulFlags, &pProfAdmin); if (!(FAILED(hr)) || (pProfAdmin)) { - hr = pProfAdmin->CreateProfile(szProfileName, NULL, NULL, 0); + hr = pProfAdmin->CreateProfile((LPTSTR)mir_t2a(szProfileName), NULL, NULL, ulFlags); if (!FAILED(hr)) { - hr = pProfAdmin->AdminServices( szProfileName, NULL, NULL, 0, &pMsgSvcAdmin); + hr = pProfAdmin->AdminServices( (LPTSTR)mir_t2a(szProfileName), NULL, NULL, ulFlags, &pMsgSvcAdmin); if ( !(FAILED(hr)) || (pMsgSvcAdmin) ) { - hr = pMsgSvcAdmin->CreateMsgService(_T("MSEMS"), _T("")/*"Microsoft Exchange Server"*/, NULL, 0); + hr = pMsgSvcAdmin->CreateMsgService((LPTSTR)("MSEMS"), (LPTSTR)("")/*"Microsoft Exchange Server"*/, NULL, 0); if (!FAILED(hr)) { @@ -609,7 +609,7 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName ) } else { - pProfAdmin->DeleteProfile(szProfileName, 0); + pProfAdmin->DeleteProfile((LPTSTR)mir_t2a(szProfileName), ulFlags); } } -- cgit v1.2.3