All applications that load, modify, and save files track some sort of flag that indicates whether the user has made a modification to the file but has not saved the file since the changes were made. Above what your application currently does to set or clear this flag, various OLE operations, such as creating or changing an object, will also make the file dirty. Isolate set-change-flag code so that you can control the flag from any other function, such as the OLECLIENTVTBL CallBack function.