Cacheing MFC menues
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Thread: Cacheing MFC menues

  1. #1
    Join Date
    Jul 2013
    Posts
    7

    Cacheing MFC menues

    I have an VS 2010 VC++ project. I have changed a few things in the .rc file but the changes are not appearing when I debug the program. I have taken the .exe to another computer and the changes appear. Is there something that caches the resources? There are no errors when I compile or debug the program. I have tried "build clean", "rebuild" and "build solution". I have also tried to remove the whole debug directory. I have looked at the .res file in the debug directory and it has the changes.

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    11,978

    Re: Cacheing MFC menues

    I have no idea, but I had the same problem a few days ago. After an hour or so it started getting it right, but I don't know why they didn't reflect the changes right away or what changed to make them start working.

  3. #3
    Join Date
    Jul 2013
    Posts
    7

    Re: Cacheing MFC menues

    It has been at least 6 hours and I have restarted the computer a few times since then. I am at a loss.

  4. #4
    Join Date
    Jul 2013
    Location
    USA
    Posts
    30

    Re: Cacheing MFC menues

    Try clicking on "Clean Solution" under the build menu then hit F5 to Rebuild.

  5. #5
    Join Date
    Jul 2013
    Posts
    7

    Re: Cacheing MFC menues

    Did that too.

  6. #6
    Join Date
    Jul 2013
    Location
    USA
    Posts
    30

    Re: Cacheing MFC menues

    Hmmm that would have forced every file to compile whether there were changes or not so I am at a loss as well. Have you tried deleting the .ncb file and then recompiling?

  7. #7
    Join Date
    Jul 2013
    Posts
    7

    Re: Cacheing MFC menues

    I don't think it is a compile issue. The .res file in the debug directory has the correct information and the .exe file works correctly on another computer; it just does not work n the dev computer. It looks like the menus are being cached somewhere. Someone suggested it might be the registry but I can not find an entry dealing with menus.

  8. #8
    Join Date
    Jul 2013
    Location
    USA
    Posts
    30

    Re: Cacheing MFC menues

    The registry settings for your application will all be stored under HKEY_CURRENT_USER -> Software and then whatever name you passed with SetRegistryKey() in your CWinApp except the states that are saved in the registry would be for docking and window placement it does not save any info on menus unless you manually save and restore the settings yourself which by the sounds of it you haven't. I use VC6 on VS2008 Professional but like you said if the .exe is working on another computer than it is definitely compiling correctly. Also since your .exe is working on another computer that shows it is not a registry issue since the .exe will be updating the registry with the same info no matter where it is run. It must be an issue involving the OS but I have never heard of Windows or any OS for that matter caching Menus. I am sorry I couldn't help with a solution but I will keep looking for you.

  9. #9
    Join Date
    Jul 2013
    Posts
    7

    Re: Cacheing MFC menues

    Quote Originally Posted by RobNHood View Post
    Have you tried deleting the .ncb file and then recompiling?
    There is no .ncb file for the project.

  10. #10
    Join Date
    Jul 2013
    Posts
    7

    Re: Cacheing MFC menues

    I changed the menu again and tried running it on the second computer; the menu didn't change. It looks like the menu get set up the first time the program runs and then does not change after that. Where would menu information be cached?

  11. #11
    Join Date
    Jul 2013
    Location
    USA
    Posts
    30

    Re: Cacheing MFC menues

    Disregard the post regarding deleting the .ncb file. VS2010 doesn't create them.

  12. #12
    Join Date
    Jul 2013
    Posts
    7

    Re: Cacheing MFC menues

    Quote Originally Posted by RobNHood View Post
    The registry settings for your application will all be stored under HKEY_CURRENT_USER -> ...
    I deleted the entry and it worked. I have no idea what went wrong.

  13. #13
    Join Date
    Jul 2013
    Location
    USA
    Posts
    30

    Re: Cacheing MFC menues

    Just to be precise... Is the menu in question for your main window and how are you creating and attaching the menus are they being created on the heap?

  14. #14
    Join Date
    Jul 2013
    Location
    USA
    Posts
    30

    Re: Cacheing MFC menues

    If it worked that's great. Might be some outdated info in the registry which was interfering with the app. Sometimes as applications change and evolve it's sometimes good to clear the old registry settings.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center