Article # 270, added by Geoworks, historical record
| first | previous | index | next | last |

Using undo with a text object.



Q. How does one implement the Undo function with a VisText object?
   We are using the GenEditControl and setting the VTF_ALLOW_UNDO
   feature, however we receive an error stating the context must be
   set up before issuing undo messages.

A. The context is a number to allow for multiple undo's, which you
   must set manually (so that you can have a different context for
   each text object).  What you can do is send
   MSG_GEN_PROCESS_UNDO_SET_CONTEXT sometime before the application
   starts tracking undo-able things.  One place to send this message
   is in MSG_GEN_PROCESS_OPEN_APPLICATION.

   Here's an example:

   dword oldContext;
   oldContext = @call MyProcess::MSG_GEN_PROCESS_UNDO_SET_CONTEXT( 1 );