Introduction

In some (or most?) cases, when we are using dialog windows to communicate with the user,
we need to save/restore state of checkboxes, edit controls, radio buttons, etc.
There are several possibilities of how to do it. You can program functions newly
for every dialog window or use "universal" solution. I created for myself
one simple class that I am using in most cases with no changes.
All that you will need to implement this function into your application
is to add five lines of code to your dialog source file.

Using the code

First of all, if you want to use CDialogSettings class in your
application, you must include these header files:

To restore dialog controls' states (text of edit controls, checked/unchecked state
of checkboxes, etc.) we will need to add the following two lines of code to the dialog
initialization routine. If you are creating a non-MFC application,
insert CDialogSettings class here:

Code that will store dialog controls' state (CDialogSettings
class uses registry) you can add into the IDOK handler (you need to save settings only if
the user
confirms dialog), or into the WM_DESTROY / OnDestroy routine.
In the non-MFC application, it will look like this:

History

24. February 2004 - First release.

1. March 2004 - Updated project.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

I was realy searching for this, now i don't need more to use ini files to save and load settings. and the best, is your code can do alot more than the ini's ever could. it's realy great to save and load your dialog settings from and to the registry. your code got my 5 stars, respect. all you need to use the dlgset class in your mfc project is:
------------------------------------------
- make sure you have ON_WM_DESTROY() in

If you got this error, I think you changed the name of the dialog procedure "dialogProc". Project is OK. Variable can be "marked" as "int" if is not defined Variable 4 is dialogProc and it is a window procedure, so pointer to this procedure isn't type int.

I haven't changed anything to the programme and I'm also having the same problem: the application doesn't work and I get the same error message. I don't think I understand your reply either. I think the error message is saying that it can not convert it into an 'int'. It is not that variable which is at fault! Moreover, I don't think you have come up with a solution. Reading through the documentation, I am confused to where exactly the lines of codes should go in a new programme. I am very sorry but I can't get into this project at all which is a shame because it looks like it could be very interesting.