Click here to Skip to main content
15,905,563 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: an interview question Pin
Jose Lamas Rios5-Jul-05 8:40
Jose Lamas Rios5-Jul-05 8:40 
GeneralRe: an interview question Pin
David Crow5-Jul-05 9:18
David Crow5-Jul-05 9:18 
GeneralRe: an interview question Pin
qudayong5-Jul-05 9:46
qudayong5-Jul-05 9:46 
GeneralRe: an interview question Pin
David Crow5-Jul-05 9:55
David Crow5-Jul-05 9:55 
GeneralRe: an interview question Pin
Toby Opferman5-Jul-05 9:59
Toby Opferman5-Jul-05 9:59 
GeneralRe: an interview question Pin
Tim Smith5-Jul-05 13:20
Tim Smith5-Jul-05 13:20 
GeneralRe: an interview question Pin
qudayong5-Jul-05 15:14
qudayong5-Jul-05 15:14 
GeneralRe: an interview question of undo/redo Pin
Chris Losinger5-Jul-05 15:27
professionalChris Losinger5-Jul-05 15:27 
for text, it's pretty easy:

when the user performs an action, save the action in a stack, then perform the action on the document. for undo, pop the last action off the stack and reverse the action.

the trick is to define 'action' in such a way that you can undo it.

ex. for deleting text, save the deleted text and its position as the action (to undo, insert the deleted text at the position). for inserting text, save the position and the number of characters added (to undo, remove the number of characters at the position).




Cleek | Image Toolkits | Thumbnail maker

GeneralRe: an interview question of undo/redo Pin
qudayong6-Jul-05 1:59
qudayong6-Jul-05 1:59 
GeneralRe: an interview question of undo/redo Pin
Chris Losinger6-Jul-05 2:13
professionalChris Losinger6-Jul-05 2:13 
GeneralRe: an interview question of undo/redo Pin
Mister Transistor14-Jul-05 3:30
Mister Transistor14-Jul-05 3:30 
GeneralRe: an interview question of undo/redo Pin
qudayong6-Jul-05 4:34
qudayong6-Jul-05 4:34 
GeneralRe: HELP VC++ my program is stuck. Pin
Wes Aday5-Jul-05 7:51
professionalWes Aday5-Jul-05 7:51 
GeneralRe: HELP VC++ my program is stuck. Pin
Anonymous5-Jul-05 8:44
Anonymous5-Jul-05 8:44 
QuestionHow to execute a file in memory being of type CMemFile Pin
Anonymous5-Jul-05 7:15
Anonymous5-Jul-05 7:15 
AnswerRe: How to execute a file in memory being of type CMemFile Pin
David Spain5-Jul-05 17:56
David Spain5-Jul-05 17:56 
GeneralRe: How to execute a file in memory being of type CMemFile Pin
Jose Lamas Rios5-Jul-05 18:25
Jose Lamas Rios5-Jul-05 18:25 
GeneralRe: How to execute a file in memory being of type CMemFile Pin
David Spain5-Jul-05 19:10
David Spain5-Jul-05 19:10 
GeneralProxy authentication Pin
Geert van Horrik5-Jul-05 6:04
Geert van Horrik5-Jul-05 6:04 
GeneralRebar controls Pin
__makaveli__5-Jul-05 5:36
__makaveli__5-Jul-05 5:36 
Questionhow to protect dll from replacement. Pin
Abdul Munaf Chhatra5-Jul-05 3:26
Abdul Munaf Chhatra5-Jul-05 3:26 
AnswerRe: how to protect dll from replacement. Pin
David Crow5-Jul-05 3:43
David Crow5-Jul-05 3:43 
AnswerRe: how to protect dll from replacement. Pin
«_Superman_»5-Jul-05 4:01
professional«_Superman_»5-Jul-05 4:01 
QuestionMS Word View->Print-Layout code? Pin
Maverick5-Jul-05 3:10
Maverick5-Jul-05 3:10 
AnswerRe: MS Word View->Print-Layout code? Pin
Chris Meech5-Jul-05 6:33
Chris Meech5-Jul-05 6:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.