//Setup the ascii versions of the profile name and password
int nProfileLength = sProfileName.Length();
//Setup the ascii versions of the profile name and password
int nProfileLength = sProfileName.Length();
LPSTR pszProfileName = NULL;
LPSTR pszPassword = NULL;
wxCharBuffer cbProfile(1),cbPassword(1);
if (nProfileLength)
{
LPSTR pszProfileName = NULL;
LPSTR pszPassword = NULL;
wxCharBuffer cbProfile(1),cbPassword(1);
if (nProfileLength)
{
ULONG nError = m_data->m_lpfnMAPILogoff(m_data->m_hSession, 0, 0, 0);
if (nError != SUCCESS_SUCCESS)
{
ULONG nError = m_data->m_lpfnMAPILogoff(m_data->m_hSession, 0, 0, 0);
if (nError != SUCCESS_SUCCESS)
{
wxASSERT(m_data->m_hSession); //MAPI session handle must be valid
//Call the MAPIResolveName function
wxASSERT(m_data->m_hSession); //MAPI session handle must be valid
//Call the MAPIResolveName function
ULONG nError = m_data->m_lpfnMAPIResolveName(m_data->m_hSession, 0, lpszAsciiName, 0, 0, lppRecip);
if (nError != SUCCESS_SUCCESS)
{
ULONG nError = m_data->m_lpfnMAPIResolveName(m_data->m_hSession, 0, lpszAsciiName, 0, 0, lppRecip);
if (nError != SUCCESS_SUCCESS)
{
- wxLogDebug(_T("Failed to resolve the name: %s, Error:%d\n"), sName, nError);
+ wxLogDebug(_T("Failed to resolve the name: %s, Error:%ld\n"),
+ sName.c_str(), nError);
mapiMessage.nRecipCount = message.m_to.GetCount() + message.m_cc.GetCount() + message.m_bcc.GetCount();
wxASSERT(mapiMessage.nRecipCount); //Must have at least 1 recipient!
mapiMessage.nRecipCount = message.m_to.GetCount() + message.m_cc.GetCount() + message.m_bcc.GetCount();
wxASSERT(mapiMessage.nRecipCount); //Must have at least 1 recipient!
if (Resolve(sName, (void*) &lpTempRecip))
{
//Resolve worked, put the resolved name back into the sName
if (Resolve(sName, (void*) &lpTempRecip))
{
//Resolve worked, put the resolved name back into the sName
//Don't forget to free up the memory MAPI allocated for us
m_data->m_lpfnMAPIFreeBuffer(lpTempRecip);
}
//Don't forget to free up the memory MAPI allocated for us
m_data->m_lpfnMAPIFreeBuffer(lpTempRecip);
}
if (Resolve(sName, (void*) &lpTempRecip))
{
//Resolve worked, put the resolved name back into the sName
if (Resolve(sName, (void*) &lpTempRecip))
{
//Resolve worked, put the resolved name back into the sName
//Don't forget to free up the memory MAPI allocated for us
m_data->m_lpfnMAPIFreeBuffer(lpTempRecip);
}
//Don't forget to free up the memory MAPI allocated for us
m_data->m_lpfnMAPIFreeBuffer(lpTempRecip);
}
//Don't forget to free up the memory MAPI allocated for us
m_data->m_lpfnMAPIFreeBuffer(lpTempRecip);
}
//Don't forget to free up the memory MAPI allocated for us
m_data->m_lpfnMAPIFreeBuffer(lpTempRecip);
}
ZeroMemory(&file, sizeof(MapiFileDesc));
file.nPosition = 0xFFFFFFFF;
wxString& sFilename = message.m_attachments[i];
ZeroMemory(&file, sizeof(MapiFileDesc));
file.nPosition = 0xFFFFFFFF;
wxString& sFilename = message.m_attachments[i];
if (nTitleSize && !message.m_attachmentTitles[i].IsEmpty())
{
wxString& sTitle = message.m_attachmentTitles[i];
if (nTitleSize && !message.m_attachmentTitles[i].IsEmpty())
{
wxString& sTitle = message.m_attachmentTitles[i];