Okay, I have this program in VC++ 6. It consists of 2 dialogs as of now. The first has you provide a username and password for future logins. The second just verifies that you typed your password correctly. If the two match, then it saves to a file called 'userssave.ska' which is nothing more than simple text as of now. If they don't match, you're supposed to get a dialog box stating so. Neither of these are happening...can someone give me some help?

I will post that particular function here, and include the entire project for download.
Code:
void PassConf::OnCheckpass() 
{

	ofstream userssave("c:\\usersave.ska", ios::trunc, ios::binary); 
	if (m_passwordconf != ((CWRITERS_BLOCKDlg*)parent)->m_password) //they don't match
	{
		MessageBox("The passwords do not match.", "Invalid Password", MB_ICONEXCLAMATION);
		
	}
	else
	{
		userssave << ((CWRITERS_BLOCKDlg*)parent)->m_username << endl << flush;
		userssave << ((CWRITERS_BLOCKDlg*)parent)->m_password << endl << flush;
		userssave.flush();
		OnOK(); //exit this dialog
	}
}

The file attached does not include the contents of the debug folder, as that is huge, so you will have to compile it on your own.


[EDIT]
I have since updated the function, but to no avail:
Code:
void PassConf::OnCheckpass() 
{

	ofstream userssave("c:\\usersave.ska", ios::trunc, ios::binary); 
	if (m_passwordconf != ((CWRITERS_BLOCKDlg*)parent)->m_password) //they don't match
	{
		MessageBox("The passwords do not match.", "Invalid Password", MB_ICONEXCLAMATION);
		
	}
	else
	{
		userssave << (LPCTSTR)((CWRITERS_BLOCKDlg*)parent)->m_username << endl << flush;
		userssave << (LPCTSTR)((CWRITERS_BLOCKDlg*)parent)->m_password << endl << flush;
		userssave.flush();
		userssave.close();
		OnOK(); //exit this dialog
	}
[/EDIT]