Lookup WritePrivateProfileString and GetPrivateProfileString in MSDN, or search the forum. You could also search for information on using .INI files. You should find what you are looking for fairly quickly.
The situation here is I have a SDI application and a dll file.
When I run the a menu from the application, a dialog box will popup and I would like to be able to write the inputs to a file and to be able to open the file when i need it.
Is it possible ?
If so can you tell me the way to do it in steps.
1 more point to note is that the dialog box is created in the application and the functions will be called from the dll.
Originally posted by Kel
Does anyone know what has to be done to save the informations entered in a dialog box to a file and to retrieve it when needed?
The application is a SDI and the dialog box is called from the menu.
see attached. just press File->New and see the rest.
Although I have not looked at the code myth7676 attached here (maybe your answer is there), if you want a specific answer you need to be tad more specific about want you want.
For example:
Is this dialog box something that you use to save settings?
i.e. You only need to save the most recent data from the dialog box and you also need to read this information back into the dialog box's controls everytime the dialog box is shown. In this type of situation .INI files, or using the registry is good.
Or, is this something where you want the information in the dialog box, appended to a file, so that you save every entry ever made (unless of course you edit the file yourself), and you do not need to read the file from within the program?
Either way it is possible to do what you want, but you would use different methods depending on exactly what your needs are.
Also, are you using member variables for you controls on your dialog box? (and what types of controls).
If you are looking for specific steps, then this info will help you to get a more relevant answer.
Let's say its something like a username and password storage file.
When running the program for the first time, there's no file being created and when I enter 1 set of information and save it, the file will be created and the information will be stored in the file and when I enter the next set of information, the datas will be added into the file.
I would also like to be able to retrieve the set of information I've entered either by searching base on name or by browsing all the records (either method will do)
One possibilty would be to make the entries comma delimeted,
i.e.
EDIT1: 222 333
EDIT2: 333 444
EDIR1: 555 666
EDIT2: 777 888
stored in file like this:
222 333,333 444
555 666,777 888
and then read the file line by line, storing the values in variables and comparing those values to the value you are looking for, stopping when you founnd the value you are looking for, etc
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.