See thats the problem.. I'm not a programmer and don't foresee myself as being a programmer, however this class is required for my degree for which I would like to pursue a career in networking, although I know programming is a part of everything generally computer related. [...] The reason I'm here the night before it's due is because the first week of the assignment it was midterms week, the following week after that was spring break in which I was away for that whole week.. so here I am
I'd say you were on the right track as far as adding the .txt filter to the open/save dialogs. Having seen the rest of the program now, I'd say you probably don't want to make separate Import/Export methods. However, the way you had added the filter, your code was replacing the .xml, rather than adding .txt in addition to the .xml. So you'll want to modify that code so that the dialog can allow the user to choose both .txt and .xml formats.From there, you're going to need to look at the Load() and Save() methods, to make them handle both loading/saving .txt in addition to .xml.Personally my approach would probably be to rename the current Load() and Save() methods to LoadXML() and SaveXML(). Then make new Load() and Save() methods which examine the filename passed in, looking at whether the filename ends in .txt or .xml. If it ends in .xml, then call the LoadXML() or SaveXML() method. Otherwise if it ends in .txt, call a new method LoadTXT() or SaveTXT(), which you will need to write.BTW, feel free to post the compiler errors when you try to compile with VC 2005. We can probably figure out why it's not finding the header files.
------ Build started: Project: Project, Configuration: Debug Win32 ------Compiling...Xml.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryTranslate.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directorySystemTray.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryStdAfx.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directorySplash.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directorySAPrefsSubDlg.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directorySAPrefsStatic.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directorySAPrefsDialog.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryRecycleBin.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryPicture.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryold_BtnST.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryNotePosition.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryNote.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryMainFrm.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryLayeredWindowHelperST.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryHyperLink.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryErrorLog.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgUseUserInformation.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgUserInformation.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgSnooze.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryGenerating Code...Compiling...DlgSetTitle.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgSetAlarm.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgRecycleBinHelp.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgRecycleBin.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsTransparancy.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsToolbar.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsServer.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsRecycleBin.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsNewNote.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsLooks.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsLanguage.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsHotKey.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsGeneral.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsFont.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsDatabase.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsCharset.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsBehaviour.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgOptionsAlarm.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgLanguage.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgGuide.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryGenerating Code...Compiling...DlgDeleteInformation.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryDlgCreateNewLanguage.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryCMapi.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryChildView.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryBtnST.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryBCMenu.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryBase64.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryBackup.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryAutoRichEditCtrl.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryA Note.cppc:\a_note_4_2_1_src\a note\source\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directoryGenerating Code...Build log was saved at "file://c:\A_Note_4_2_1_src\A Note\Source\Debug\BuildLog.htm"Project - 50 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Ok.. I'm looking into the Load() and Save() methods right now trying to figure out how they work respectively. If i were to call a new method for which I have to write.. how much code are we looking at here? This better not take me long, I still have to type up the report to this lol.
also here are the errors.. I'm getting less errors now that I enabled MFC support, however it's still not finding afxwin.h
i think the program shouldn't require much altering, the program creates xml files, which can be exported, and later imported (on any machine with anote) , and these xml files are interpreted by anote so thate "notes" are generated/saved. good thing that xml is just a way to structure data, and very much like a .txt file. so all the code that converts the xml into notes should be able to stay the same, and you just have to add the ability to select a .txt file, and make sure that file is converted to the notes, and as far as i can tell, the only difference is the file extension.
If this assignment really is as simple as just adding a ".txt" filter option to the file dialog, then I would say Nautica 'lucked out'. In the real world a 'txt' exporter is not going to be the same format as a 'xml' exporter. (It would be "incomprehensible." )
So does that mean what I have is somewhat correct?
I'm not sure how to guess. It would be wrong if this were any kind of real-world assignment. Do you have your instructor's actual words describing this assignment handy?
here is the assignment, word for word.----Change request: This change requests consists of adding new import/export features to
Compiling...MainFrm.cppc:\program files\microsoft visual studio 8\vc\platformsdk\include\atlbase.h(513) : warning C4996: '_vsnprintf' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\stdio.h(339) : see declaration of '_vsnprintf' Message: 'This function or variable may be unsafe. Consider using _vsnprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'c:\program files\microsoft visual studio 8\vc\platformsdk\include\atlbase.h(537) : warning C4996: '_vsnprintf' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\stdio.h(339) : see declaration of '_vsnprintf' Message: 'This function or variable may be unsafe. Consider using _vsnprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'c:\program files\microsoft visual studio 8\vc\platformsdk\include\atlbase.h(561) : warning C4996: '_vsnwprintf' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\stdio.h(450) : see declaration of '_vsnwprintf' Message: 'This function or variable may be unsafe. Consider using _vsnwprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'c:\program files\microsoft visual studio 8\vc\platformsdk\include\atlbase.h(584) : warning C4996: '_vsnwprintf' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\stdio.h(450) : see declaration of '_vsnwprintf' Message: 'This function or variable may be unsafe. Consider using _vsnwprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'c:\a_note_4_2_1_src\a note\source\mainfrm.cpp(802) : warning C4312: 'type cast' : conversion from 'UINT' to 'HMENU' of greater sizec:\a_note_4_2_1_src\a note\source\mainfrm.cpp(803) : warning C4312: 'type cast' : conversion from 'UINT' to 'HMENU' of greater sizec:\a_note_4_2_1_src\a note\source\mainfrm.cpp(887) : warning C4101: 'szFilter' : unreferenced local variablec:\a_note_4_2_1_src\a note\source\mainfrm.cpp(917) : warning C4101: 'szFilter' : unreferenced local variablec:\a_note_4_2_1_src\a note\source\mainfrm.cpp(1362) : warning C4800: 'CNote *' : forcing value to bool 'true' or 'false' (performance warning)c:\a_note_4_2_1_src\a note\source\mainfrm.cpp(2104) : warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(566) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'int', possible loss of data c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(563) : while compiling class template member function 'void CArray<TYPE,ARG_TYPE>::Dump(CDumpContext &) const' with [ TYPE=HICON, ARG_TYPE=HICON ] c:\a_note_4_2_1_src\a note\source\systemtray.h(154) : see reference to class template instantiation 'CArray<TYPE,ARG_TYPE>' being compiled with [ TYPE=HICON, ARG_TYPE=HICON ]c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(566) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'int', possible loss of data c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(563) : while compiling class template member function 'void CArray<TYPE,ARG_TYPE>::Dump(CDumpContext &) const' with [ TYPE=int, ARG_TYPE=int & ] c:\a_note_4_2_1_src\a note\source\bcmenu.h(278) : see reference to class template instantiation 'CArray<TYPE,ARG_TYPE>' being compiled with [ TYPE=int, ARG_TYPE=int & ]c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1105) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'int', possible loss of data c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1102) : while compiling class template member function 'void CList<TYPE,ARG_TYPE>::Dump(CDumpContext &) const' with [ TYPE=CMainFrame::tagCString, ARG_TYPE=CMainFrame::tagCString & ] c:\a_note_4_2_1_src\a note\source\mainfrm.h(58) : see reference to class template instantiation 'CList<TYPE,ARG_TYPE>' being compiled with [ TYPE=CMainFrame::tagCString, ARG_TYPE=CMainFrame::tagCString & ]c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1105) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'int', possible loss of data c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1102) : while compiling class template member function 'void CList<TYPE,ARG_TYPE>::Dump(CDumpContext &) const' with [ TYPE=void *, ARG_TYPE=void * ] c:\a_note_4_2_1_src\a note\source\mainfrm.h(124) : see reference to class template instantiation 'CList<TYPE,ARG_TYPE>' being compiled with [ TYPE=void *, ARG_TYPE=void * ]c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1518) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'int', possible loss of data c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1515) : while compiling class template member function 'void CMap<KEY,ARG_KEY,VALUE,ARG_VALUE>::Dump(CDumpContext &) const' with [ KEY=CSAPrefsSubDlg *, ARG_KEY=CSAPrefsSubDlg *, VALUE=DWORD, ARG_VALUE=DWORD & ] c:\a_note_4_2_1_src\a note\source\saprefsdialog.h(143) : see reference to class template instantiation 'CMap<KEY,ARG_KEY,VALUE,ARG_VALUE>' being compiled with [ KEY=CSAPrefsSubDlg *, ARG_KEY=CSAPrefsSubDlg *, VALUE=DWORD, ARG_VALUE=DWORD & ]c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1105) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'int', possible loss of data c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1102) : while compiling class template member function 'void CList<TYPE,ARG_TYPE>::Dump(CDumpContext &) const' with [ TYPE=CDlgRecycleBin::tagCString, ARG_TYPE=CDlgRecycleBin::tagCString & ] c:\a_note_4_2_1_src\a note\source\dlgrecyclebin.h(55) : see reference to class template instantiation 'CList<TYPE,ARG_TYPE>' being compiled with [ TYPE=CDlgRecycleBin::tagCString, ARG_TYPE=CDlgRecycleBin::tagCString & ]c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1105) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'int', possible loss of data c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1102) : while compiling class template member function 'void CList<TYPE,ARG_TYPE>::Dump(CDumpContext &) const' with [ TYPE=tagNote, ARG_TYPE=tagNote & ] c:\a_note_4_2_1_src\a note\source\dlgrecyclebin.h(56) : see reference to class template instantiation 'CList<TYPE,ARG_TYPE>' being compiled with [ TYPE=tagNote, ARG_TYPE=tagNote & ]c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1105) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'int', possible loss of data c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(1102) : while compiling class template member function 'void CList<TYPE,ARG_TYPE>::Dump(CDumpContext &) const' with [ TYPE=CRecycleBin::tagCString, ARG_TYPE=CRecycleBin::tagCString & ] c:\a_note_4_2_1_src\a note\source\recyclebin.h(35) : see reference to class template instantiation 'CList<TYPE,ARG_TYPE>' being compiled with [ TYPE=CRecycleBin::tagCString, ARG_TYPE=CRecycleBin::tagCString & ]c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(566) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'int', possible loss of data c:\program files\microsoft visual studio 8\vc\platformsdk\include\afxtempl.h(563) : while compiling class template member function 'void CArray<TYPE,ARG_TYPE>::Dump(CDumpContext &) const' with [ TYPE=CMapiRecipient, ARG_TYPE=CMapiRecipient & ] c:\a_note_4_2_1_src\a note\source\cmapi.h(64) : see reference to class template instantiation 'CArray<TYPE,ARG_TYPE>' being compiled with [ TYPE=CMapiRecipient, ARG_TYPE=CMapiRecipient & ]Build log was saved at "file://c:\A_Note_4_2_1_src\A Note\Source\Debug\BuildLog.htm"Project1 - 0 error(s), 19 warning(s)========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
it didn't make much sense to me that the project would be that easy, but the functionality of the project doesnt make much sense to me either. only anote creates, and displays the files, so i'm not sure why you are changing the format (maybe other than to learn something) or in this case pretty much pass the class : )
that's pretty weird, because it doesn't specifiy how much of the structure to change, i'd say get rid of xml formatting..