Registry location for storing data


  1. Posts : 261
    Windows 10 Pro x64 Version 1903
       #1

    Registry location for storing data


    I'm creating a new release (version 5) of an application whose registry contents won't be compatible with earlier releases, so I changed my code to write everything under:

    HKCU\Software\DeepSkyStacker\DeepSkyStacker5

    and that is working just fine.

    However there's a custom control that I use that us storing all its stuff using:

    AfxGetApp()->WriteProfileBinary(_T("PictureList"), _T("Settings") ...);

    and that stuff ends up here:

    HKCU\Software\DeepSkyStacker\DeepSkyStacker\PictureList\Settings

    However I want it to be written to:

    HKCU\Software\DeepSkyStacker\DeepSkyStacker5\PictureList\Settings

    Does anyone know the necessary incantation to achieve this please?

    Solution found!

    Code:
        //
        // Set our Profile Name to DeepSkyStacker5 so native Windows registry stuff will be written under "DeepSkyStacker\\DeepSkyStacker5"
        // 
        // First free the string allocated by MFC at CWinApp startup.
        // The string is allocated before InitInstance is called.
        free((void*)m_pszProfileName);
        // Change the name of the registry profile to use.
        // The CWinApp destructor will free the memory.
        m_pszProfileName = _tcsdup(_T("DeepSkyStacker5"));
    Thanks
    David

    Changing registry key used by Windows code (not mine) to store stuff.All my registry (QSettings) work for the new version is being written to HKCU/Software/DeepSkyStacker/DeepSkyStacker5Something is stubbornly writing toHKCU/Software/DeepSkyStacker/DeepSkyStackerWhat to I have to change in CWinApp to make it use the other section???
    Last edited by perdrix; 09 May 2020 at 08:58.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:19.
Find Us




Windows 10 Forums