user3161924
user3161924

Reputation: 2273

MFC: Registry key for the application has random GUID keys added with a blank REG_SZ value named "Untitled"?

I noticed that my MFC based applications (also using BCGControlBar Pro) is creating several keys under the application key with a GUID (e.g. Computer\HKEY_CURRENT_USER\SOFTWARE\Acme\Program Name\3CF4873E-E8CC-4e67-A3D2-56F5B610B4FA). In those keys are a single REG_SZ value named Untitled with the Data blank (empty string).

This must be something the framework is doing because I don't create them. What are these and how do I stop it from happening?

Thanks.

Upvotes: 1

Views: 116

Answers (1)

user3161924
user3161924

Reputation: 2273

The problem was as @Adrian Mole suspected above. It has to do with the Restart Manager implementation in MFC. The interesting thing is I couldn't reproduce the problem in a Debug build, only a Release build.

Since my application really isn't document based where you open and save a file, I was able to solve it by changing the option in the MFC CWinApp class for my application from:

m_dwRestartManagerSupportFlags=AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS;

to

m_dwRestartManagerSupportFlags=AFX_RESTART_MANAGER_SUPPORT_RESTART | AFX_RESTART_MANAGER_SUPPORT_RECOVERY;

Also, in the windows-classic-samples-master you'll find a rmfilterapp you can modify to easily test your app using the Restart Manager.

Upvotes: 0

Related Questions