PDA

View Full Version : Strage behaviour writing to INI files - key being deleted.



rdemarco
06-03-2005, 01:24 AM
Hi,

I am sure it's by design but I don't know how to get around a problem I am having using the function WriteProfString. I have a dialog with enables users type type in INI information, I then use this information and overwrite an existing key in the INI. This all works fine except when I click Cancel and the uninstall process removes the full key and value in the INI file.

I saw in the documentation that it will remove the key/value only if a list of criteria is true and one being if the key didn't already exist, although in my case my key already existed and always does. The only way I got around this was to turn logging off before updating the value and then turning it back on.

Can someone please help me understand what I am doing wrong and how I can get the value to return to its original state and not having it deleted?

Thanks, Rick