Resource Header Problem in Orcas March CTP

In a previous post I explained than when you create a MFC application with the March CTP of ‘Orcas’ and add a command or split button to a dialog, the .rc file is not compiled, because styles such as BS_COMMANDLINK are not found. My workaround for the moment was to redeclare them in the resource.h header. But that is not a good idea, because the IDE overwrites the file, removing what you put there. So, eventually, I brought that up to the VC++ team, and it seems that the March CTP has a problem with the resource headers, used by the resource compilers. In other words, at least commctrl.rc was not updated to contain the required definitions.

You can work around this in two better ways:

  • install the Windows RTM SDK, or
  • redefine the necessary styles in commctrl.rc
    #if _WIN32_WINNT >= 0x0600
    
    // BUTTON STATE FLAGS
    #define BST_DROPDOWNPUSHED      0x0400
    
    // BUTTON STYLES
    #define BS_SPLITBUTTON          0x0000000CL
    #define BS_DEFSPLITBUTTON       0x0000000DL
    #define BS_COMMANDLINK          0x0000000EL
    #define BS_DEFCOMMANDLINK       0x0000000FL
    
    #endif
    

I decided to go for the second, and now the applications are successfully built. I have been told that the problem has been already fixed for the upcoming CTP/beta. The VC++ team will soon post about this on their blog too. I want to thank to Marian Luparu for the help with this matter.

1 thought on “Resource Header Problem in Orcas March CTP”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.