I'm looking for an easy to implement, bullet proof techniques for doing updates.
Here's where I need it to work:
When I change an edit control or a radiobutton or a checkbox, etc. a change message is sent to my handler by windows.
In my code I read all my controls load a UDT and store the info. To make sure all the places I need updated do indeed get updated, I clear and reload all the places the data resided including the controls that just changed to trigger the update which in turn causes a change message to be generated.
So, if I rely on change messages alone the program will go into a loop until it crashes.
I need some ideas because the ones I've tried so for don't accomplish what I need.
Any ideas out there?
LarryMc
QuoteWhen I change an edit control or a radiobutton or a checkbox, etc. a change message is sent to my handler by windows.
In my code I read all my controls load a UDT and store the info. To make sure all the places I need updated do indeed get updated, I clear and reload all the places the data resided including the controls that just changed to trigger the update which in turn causes a change message to be generated.
So, if I rely on change messages alone the program will go into a loop until it crashes.
2 untried suggestions.
Have a separate dummy window/control with its associated subroutine doing the updates and ignore messages from this window/control when it operates.
or
after the update set a flag, ignoring messages when the flag is set. Don't forget to reset the flag.
That's the best I can think of at the moment. I had a similar problem in IBasic days with a sudoku program I made. I used the flag.
Colin.
Might be awkward but, use a temp file - write all changes to the temp file and read back to memory using a flag.
You can clear and re-write the file as needed or keep a running log of changes for rollback.
Larry