Vlad"s Software Development Toolbox

Saturday, 2 June 2007

Tip: Resolving file corruption error in settings file

I made an interesting discovery when working on saving splitter position into settings file. Initially I was calling SaveSettings function located in EnvManager DLL from EXE before EnvMan is closed. I started encountering file corrupted errors and application was not saving splitter position into a file. The work around was to use HandleDestroyed event of User Control to save settings from the EnvManager DLL. So my lesson was "Never call Settings class located in the different assembly to avoid file corruption errors". I will be interested to know if any one had similar experience when working with settings class and what work around was used to fix a problem.

No comments: