Coding Text...
-
Alright... Using fstream when making a simple database using MFC... Say you want to make every letter another letter (coding)... Is it possible?
void CNewAccountDlg::OnOK() { CString strUsername; CString strPassword; GetDlgItemText(IDC_USERNAME,strUsername); GetDlgItemText(IDC_PASSWORD,strPassword); ofstream a_file ( "data/account.dat", ios::ate, ios::app); a_file<< strUsername + " " + strPassword + "\n"; a_file.close(); AfxMessageBox("Account Created."); }
Nothing wrong with that... Makes a simple file with Username and Password. How could i break my GetDlgItemText into single CHAR allowing me to change them and regroup them back together? Is it possible to break down a String into single Characters? /* Just a Human Trying to Live in a Computers World. */ -
Alright... Using fstream when making a simple database using MFC... Say you want to make every letter another letter (coding)... Is it possible?
void CNewAccountDlg::OnOK() { CString strUsername; CString strPassword; GetDlgItemText(IDC_USERNAME,strUsername); GetDlgItemText(IDC_PASSWORD,strPassword); ofstream a_file ( "data/account.dat", ios::ate, ios::app); a_file<< strUsername + " " + strPassword + "\n"; a_file.close(); AfxMessageBox("Account Created."); }
Nothing wrong with that... Makes a simple file with Username and Password. How could i break my GetDlgItemText into single CHAR allowing me to change them and regroup them back together? Is it possible to break down a String into single Characters? /* Just a Human Trying to Live in a Computers World. */NewbieStats wrote: GetDlgItemText into single CHAR allowing me to change them?Is it possible to break down a String into single Characters? Look for
CString::GetAt()
NewbieStats wrote: regroup them back together? Is it possible to break down a String into single Characters? look atCString::SetAt()
,But beware in this allocate a empty buffer to CString before using CString::SetAt() function
[Vote One Here, Complete my Survey....] Alok Gupta
visit me at http://www.thisisalok.tk "I Think Believe this Will Help" -
NewbieStats wrote: GetDlgItemText into single CHAR allowing me to change them?Is it possible to break down a String into single Characters? Look for
CString::GetAt()
NewbieStats wrote: regroup them back together? Is it possible to break down a String into single Characters? look atCString::SetAt()
,But beware in this allocate a empty buffer to CString before using CString::SetAt() function
[Vote One Here, Complete my Survey....] Alok Gupta
visit me at http://www.thisisalok.tk "I Think Believe this Will Help"Would it be Easier to do that or use; strPassword.SetSel(0,1); // ++ Copy and Paste to New CString and Add all CStrings together?... Seems like a long process, but would it be better? /* Just a Human Trying to Live in a Computers World. */
-
Would it be Easier to do that or use; strPassword.SetSel(0,1); // ++ Copy and Paste to New CString and Add all CStrings together?... Seems like a long process, but would it be better? /* Just a Human Trying to Live in a Computers World. */
NewbieStats wrote: Seems like a long process, but would it be better? Depends on You! just select that way, where you feel comfortable!
[Vote One Here, Complete my Survey....] Alok Gupta
visit me at http://www.thisisalok.tk "I Think Believe this Will Help" -
NewbieStats wrote: Seems like a long process, but would it be better? Depends on You! just select that way, where you feel comfortable!
[Vote One Here, Complete my Survey....] Alok Gupta
visit me at http://www.thisisalok.tk "I Think Believe this Will Help"Okay thanks ill try them both and see which one seems to fit better ;) /* Just a Human Trying to Live in a Computers World. */