April 18, 2024, 12:30:59 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Detecting memory changes

Started by sapero, October 02, 2007, 03:59:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sapero

October 02, 2007, 03:59:03 AM Last Edit: October 02, 2007, 05:16:29 AM by sapero
This example shows how to detect (and deny) memory changes. This technique is usefull when you need to detect
MyProperties->Visible = false;
And automatically call ShowWindow().

The detection is based on structured exception handling, here MyProperties->Visible is placed in memory with read only access, so any write attempt will generate exception, where the handler code first allows the write, then calls OnMemoryChange where you can do some actions, or restore the changed value.

EDIT: added practical example, in OnControl a single "properties->Minimize = true;" minimizes the window.

ExMember001