#include "stdafx.h"
#include "RKDBMS.h"
#include "CreateDatabase.h"
#include "afxdialogex.h"
#include <iostream>
#include <fstream>
using namespace std;
IMPLEMENT_DYNAMIC(CCreateDatabase, CDialog)
CCreateDatabase::CCreateDatabase(CWnd* pParent )
: CDialog(CCreateDatabase::IDD, pParent)
{
}
CCreateDatabase::~CCreateDatabase()
{
}
void CCreateDatabase::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CCreateDatabase, CDialog)
ON_BN_CLICKED(IDOK, &CCreateDatabase::OnBnClickedOk)
END_MESSAGE_MAP()
void CCreateDatabase::OnBnClickedOk()
{
CDialog::OnOK();
CString cs1;
GetDlgItemText(IDC_EDIT1, cs1);
string fspec = cs1 +".db";
ofstream myfile (fspec.c_str(), ios::out);
}
</fstream></iostream>
Well I have a pop up window from the SDI MFC and and what I tried to do is when I click OK, it will generate a.db file but when I check inside the folder the file is not there. How can I generate a a.db file?