the above is the acutall code minus the call funtion to SaveRecItem. Its called from another function but doesn't change or affect the data in anyway. I have stripped this down to be only one variable, in the actual code there are lots more.
void ReadRec(int number, CListBox* pListBox);
void SaveRecItem(CString filename);
// TODO: Add your command handler code here
if(adlg.DoModal() == IDOK)
//adlg.m_invoicenumber is a CString its value here would ex. "Bob" with no spaces.
strcpy(recdlg.recitem.m_invoice_c11 , adlg.m_invoicenumber);
void RecAdj::SaveRecItem(CString filename)
std::ofstream fout(filename, std::ios::binary | std::ios::app);
AfxMessageBox("Temp rec file failed to open", MB_OK);
fout.write(m_invoice_c11, sizeof(m_invoice_c11)); //as is "Bob........" is the output