|
// *********************************************************
// メールヘッダ情報受信
// 戻り値 : true 成功, false 失敗
// *********************************************************
BOOL LboxBasp::RcvList( LboxListview *Lview )
{
if ( this->User.operator == ( "" ) ) {
return false;
}
return LboxBasp::RcvList(
this->User.szLboxString,
this->Password.szLboxString,
Lview
);
}
BOOL LboxBasp::RcvList(
LboxString *LUser, LboxString *LPass, LboxListview *Lview )
{
return LboxBasp::RcvList(
LUser->szLboxString,
LPass->szLboxString,
Lview
);
}
BOOL LboxBasp::RcvList(
LPTSTR lpUser, LPTSTR lpPass, LboxListview *Lview )
{
this->ErrorDescription.SetChar(0,0);
if ( this->lib == NULL ) {
this->ErrorDescription.operator = (
"Bsmtp.dll がインストールされていません"
);
return false;
}
LPFUNC_BPOP3 DllBPOP3;
LPFUNC_BFreeArray DllBFreeArray;
DllBPOP3 =
(LPFUNC_BPOP3)GetProcAddress( lib, "BPOP3" );
if ( DllBPOP3 == NULL ) {
return false;
}
DllBFreeArray =
(LPFUNC_BFreeArray)GetProcAddress( lib, "BFreeArray" );
if ( DllBFreeArray == NULL ) {
return false;
}
int nRet;
RetArray ra;
this->ErrorDescription.SetChar( 0, 0 );
nRet = DllBPOP3(
this->POP3Server.szLboxString,
lpUser,
lpPass,
"LIST",
this->RcvDir.szLboxString,
&ra,
this->ErrorDescription.szLboxString
);
if ( nRet <= 0 ) {
return false;
}
Lview->Initialize();
Lview->AddColumn( LVCFMT_LEFT, 100, "" );
Lview->AddColumn( LVCFMT_LEFT, 100, "送信者" );
Lview->AddColumn( LVCFMT_LEFT, 100, "件名" );
Lview->AddColumn( LVCFMT_LEFT, 100, "受信日時" );
int i;
LboxToken Ltoken;
LboxString LString;
for( i = 0; i < ra.counter; i++ ) {
Lview->AddRow();
Lview->SetColumnPrintf( 0, "%d", i+1 );
Ltoken.CreateToken( ra.array[i], "\t" );
LString.operator = (Ltoken.Token[1]);
LString.Replace( "From: ", "" );
Lview->SetColumnText( 1, &LString );
LString.operator = (Ltoken.Token[0]);
LString.Replace( "Subject: ", "" );
Lview->SetColumnText( 2, &LString );
LString.operator = (Ltoken.Token[2]);
LString.Replace( "Date: ", "" );
Lview->SetColumnText( 3, &LString );
}
DllBFreeArray(&ra);
Lview->Fit();
return true;
}
| |