Saving/loading data in listbox from e.g. text file in MFC SDI ?
-
can anyone explain or point me to some link or something where i can learn how to save/load text from harddisk ? my project is to make program that can save cooking recipes with their pictures and should have search box where you can type word example "eggs" and somewhere should appear all recipes with eggs and when i select the title of some recipe example "Fish and chips" in the picture box should apper picture of the meal and in the label or something similar should apper all the ingredients for the meal my idea is thet i can put the recipes in a list box and search via edit box and i can put simple picture control for the pictures of the recipes where should appear but the problem comes with the saving all the data ( the text for the recipe and the path of the pictures ) cant put it in a string because in that case the user cant puts his own recipes and pictures... thanks in advance
-
can anyone explain or point me to some link or something where i can learn how to save/load text from harddisk ? my project is to make program that can save cooking recipes with their pictures and should have search box where you can type word example "eggs" and somewhere should appear all recipes with eggs and when i select the title of some recipe example "Fish and chips" in the picture box should apper picture of the meal and in the label or something similar should apper all the ingredients for the meal my idea is thet i can put the recipes in a list box and search via edit box and i can put simple picture control for the pictures of the recipes where should appear but the problem comes with the saving all the data ( the text for the recipe and the path of the pictures ) cant put it in a string because in that case the user cant puts his own recipes and pictures... thanks in advance
Since you are using MFC, check out
CFile
,CArchive
, and serialization. From a design perspective, don't focus on your project as a whole. Instead, work on the small pieces first (e.g., reading from and writing to a file, populating a listbox, filtering a listbox based on the contents of an edit control), and they will eventually meld themselves into a working application."Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
can anyone explain or point me to some link or something where i can learn how to save/load text from harddisk ? my project is to make program that can save cooking recipes with their pictures and should have search box where you can type word example "eggs" and somewhere should appear all recipes with eggs and when i select the title of some recipe example "Fish and chips" in the picture box should apper picture of the meal and in the label or something similar should apper all the ingredients for the meal my idea is thet i can put the recipes in a list box and search via edit box and i can put simple picture control for the pictures of the recipes where should appear but the problem comes with the saving all the data ( the text for the recipe and the path of the pictures ) cant put it in a string because in that case the user cant puts his own recipes and pictures... thanks in advance
i think i found what i was looking for so to answer briefly to anyone how may have the save problem and is searching here this link http://www.functionx.com/visualc/fileprocessing/commondlgs.htm and this link http://www.codeproject.com/KB/cpp/cfg.aspx help me a lot