// JP opened flex table

Click to See Complete Forum and Search --> : What wrong with my code


vc_Endymion
March 21st, 2002, 11:46 PM
[ccode]
void CKingPassDlg::OnBtAccount()
{
m_dlgAccount.m_str_Account_Add = m_Account.GetAccountName();
if(m_dlgAccount.DoModal()==IDOK)
{
if(m_Account.GetAccountName() != m_dlgAccount.m_str_Account_Add)//New Account
{
CFile file;
CAccount account;
//Get Stored Input Account info
if (file.Open(m_strCurDir + "\\Data\\"+m_dlgAccount.m_str_Account_Add+".kip", CFile::modeCreate|CFile::modeWrite))
{
//Set new Account name & password
account.SetAccountName(m_dlgAccount.m_str_Account_Add);
account.SetAccountPassWord(m_dlgAccount.m_str_Pass1);
//Set configuration infos of current account user
account.SetAccountReg(m_Account.GetAccountReg());
account.SetAccountBkImage(m_Account.GetAccountBkImage());
account.SetAccountTextColor(m_Account.GetAccountTextColor());
account.m_PassItemList.AssertValid();

CArchive ar(&file, CArchive::store);
account.Serialize(ar);
ar.Close();
delete &ar;

}
else
{
AfxMessageBox("Account Managing Failed due to an I/O Error!\n\rPLEASE:\n\rSend this Message to support@kibase.com , thanks a lot!\n");
}
file.Close();
DeleteObject(&account);
delete &file;


}
else//Changing password
{
m_Account.SetAccountPassWord(m_dlgAccount.m_str_Pass1);
SaveToFile();
}


}
}

[/cccode]

Dmitry Zemskov
April 17th, 2002, 10:44 PM
Remove these lines of code:
delete &ar;
delete &file;

Dmitry Zemskov
April 17th, 2002, 10:46 PM
Remove this bullsh.t too - DeleteObject(&account);

//JP added flex table