本文整理汇总了C++中Message::AddPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ Message::AddPointer方法的具体用法?C++ Message::AddPointer怎么用?C++ Message::AddPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Message
的用法示例。
在下文中一共展示了Message::AddPointer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddMessage
status_t DbxImporter::AddMessage( String &cMessage, const String &cFolder )
{
if( cMessage != "" )
{
/* Add an RFC2822 terminating sequence */
cMessage += "\r\n.\r\n";
/* Create a Mailmessage and send it back down to the application along with the relevent data */
Mailmessage *pcImport = new Mailmessage( cMessage.c_str(), cMessage.size() );
Message *pcImportMessage = new Message( M_IMPORT_NEW );
pcImportMessage->AddPointer( "message", pcImport );
pcImportMessage->AddString( "folder", cFolder );
m_pcMessenger->SendMessage( pcImportMessage );
/* Update the progress dialog & check if the user canceled */
//float vProgress = ( (double)m_nBytes / (double)m_nSize );
float vProgress = ( (double)m_nTotal / (double)m_nCount );
char zMessage[64] = { '\0' };
snprintf( zMessage, 64, "Importing message #%Ld", m_nTotal++ );
m_pcDialog->Lock();
m_pcDialog->SetMessage( zMessage );
m_pcDialog->SetProgress( vProgress );
m_bRun = !m_pcDialog->IsCancelled();
m_pcDialog->Unlock();
}
cMessage = "";
return EOK;
}
示例2: _Save
void SettingsWindow::_Save( int nCode )
{
/* Collect the current information entered in all the views */
Settings *pcSettings = new Settings();
WebSettings *pcWebSettings = new WebSettings();
std::vector<SettingsView*>::iterator i;
for( i = m_vViews.begin(); i != m_vViews.end(); i++ )
(*i)->Store( pcSettings, pcWebSettings );
/* Pass the settings back to the application */
Message *pcNewMessage = new Message( nCode );
pcNewMessage->AddPointer( "settings", (void*)pcSettings );
pcNewMessage->AddPointer( "web_settings", (void*)pcWebSettings );
Messenger cMessenger( m_pcParent );
cMessenger.SendMessage( pcNewMessage );
_SaveGui();
Close();
}
示例3: AddMessage
status_t MboxImporter::AddMessage( os::String &cMessage )
{
if( cMessage != "" )
{
if( m_bDoCrLf )
{
/* Convert linefeeds to CRLF pairs */
const char *pStart, *pEnd;
int nLf = 0;
pStart = cMessage.c_str();
while( ( pEnd = strchr( pStart, '\n' ) ) != NULL )
{
nLf++;
pStart = pEnd + 1;
}
char *pMessage = (char*)calloc( 1, cMessage.size() + nLf + 1 );
if( NULL == pMessage )
return ENOMEM;
const char *pIn;
char *pOut;
pIn = cMessage.c_str();
pOut = pMessage;
while( '\0' != *pIn )
{
if( '\n' == *pIn )
*pOut++ = '\r';
*pOut++ = *pIn++;
}
cMessage = pMessage;
free( pMessage );
}
/* Add an RFC2822 terminating sequence */
cMessage += "\r\n.\r\n";
/* Create a Mailmessage and send it back down to the application along with the relevent data */
Mailmessage *pcImport = new Mailmessage( cMessage.c_str(), cMessage.size() );
Message *pcImportMessage = new Message( M_IMPORT_NEW );
pcImportMessage->AddPointer( "message", pcImport );
pcImportMessage->AddString( "folder", m_cFolder );
m_pcMessenger->SendMessage( pcImportMessage );
/* Update the progress dialog & check if the user canceled */
float vProgress = ( (double)m_nBytes / (double)m_nSize );
char zMessage[64] = { '\0' };
snprintf( zMessage, 64, "Importing message #%Ld", m_nCount++ );
m_pcDialog->Lock();
m_pcDialog->SetMessage( zMessage );
m_pcDialog->SetProgress( vProgress );
m_bRun = !m_pcDialog->IsCancelled();
m_pcDialog->Unlock();
}
cMessage = "";
return EOK;
}