I have just started to get back into c++ after years using Perl, php and assembler and I am trying to create a simple MFC program using Visual Studio 2017 and c++ to open binary files for viewing. I am trying to work within the code created by the wizard and I have gotten stumped. I know this is probably not the best way of doing what I want to do but I am learning.
Anyways the code I am working on is:
void CAdamImageManagerDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
char documentBuffer[1000];
ar.Read(documentBuffer, 1000);
AfxMessageBox((LPCTSTR)documentBuffer);
}
}
This is called after you select a file using the standard mfc file open dialog box OnFileOpen. What I am trying to figure out is:
- how can I know what the size is of the file that was referenced in the call?
- how can I find out what the name of the file referenced is?
This is my first question on here in almost 10 years so please be gentle and not tell me how I didn't format the question properly or other things.