Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Crash with heap corruption on exit when app is localized to INI file Collapse All
Subject Author Date
Troy Wood Jan 13, 2015 - 4:50 PM

Hello,
I’ve created an MFC Dialog application based on the CExtResizableDialog class.
During development, everything was great and there were no issues.
One of the last tasks for this project is to override m_pszProfileName and point to an INI file to load/save application data (instead of the registry).
I’ve done that and the application data is loaded and saved to/from this INI file (currently in FOLDERID_ProgramData or CommonAppData) successfully, but on exit the profuis300u.dll cashes trying to unload with what appears to be a heap corruption issue (according to Visual Studio debugger).
If I revert the application back to using the registry for it’s local app data, then it does not crash and exits cleanly so clearly this is the issue.

I’ve made sure there is no call in the application to EnableSaveRestore and went as far as to add DisableSaveRestore with no change. It would seem this is a persistence issue of ProfUIS, but I do not know where/how to correct this.

Thanks-

Troy Wood Jan 14, 2015 - 10:33 AM

Thank you Art, it was my oversight of the _tcsdup() function when setting the m_pszProfileName string. All is working now-

Art Wilkes Jan 14, 2015 - 9:33 AM

Please advise the coder to pay attention to the “m_pszProfileName” allocation. Must be “m_pszProfileName = _tcsdup(“your ini file”)” or it must be set to NULL on exit instance before calling base class.