Visual Studio Developer Center > Visual Studio Forums > Visual Studio Extensibility > VS2008 SDK: Placing configuration property pages into nested categories (like visual c++)?

Answered VS2008 SDK: Placing configuration property pages into nested categories (like visual c++)?

  • Thursday, September 11, 2008 1:49 PM
     
     
    Hi,

    While using the VS2008 SDK, I added a lot of properties and subcategories to the configuration dependant property pages.
    I am using the c/c++ style property page. (so the project set this.SupportsProjectDesigner=false;)


    I was wondering how can you add property pages nested in parent property page categories, such as the way (General, Optimization, Preprocessor, Code Generation, etc..) are nested under the (C/C++) property page node in VisualC++?

    i.e.
    ...
    - C/C++
       |
       |-General
       |
       |-Optimization
       |
       |-Preprocessor
       |
       |- ...
    + Linker
    + Manifest Tool
    ...

    Thanks

    Eric
    • Edited by emaines Thursday, September 11, 2008 1:56 PM more correction
    •  

Answers

  • Thursday, September 11, 2008 2:01 PM
     
     Answered Has Code
    Hmm from the looks of it IVsPropertyPage could be the interface to implement in your property page class.
    Going to check that now.

    Yeah, it works.

    Implement IVsPropertyPage and then you can control the subcategories by implementing
    int CategoryTitle( 
        uint iLevel, 
        out string pbstrCategory 

    accordingly.

    From the help:

    If your property page does not have a category and you would prefer it to show on the top level of the tree view directly under the appropriate top-level category, then either implement IPropertyPage alone, or return E_NOTIMPL from this method.

    1. Otherwise, the environment first calls this method with an iLevel value of zero.

    2. You can then return the name of the category that should be the closest direct ancestor of this page in the tree.

    3. The environment will then call you with an iLevel value of one.

    4. If you want your page to be indented one level, then return S_FALSE.

    5. The environment continues to call this method, increasing the value of iLevel by one each time, until you return something other than S_OK, or you reach the environment's internal limit of what it supports.

    Returning E_NOTIMPL and S_FALSE stops processing without showing an error to the user. Any value other than S_OK can cause error information to be shown to the user.

    Currently the environment only supports two levels of categories:

    CatLevel1

    CatLevel0

    PageName

    The Visual Studio categories, Common Properties and Configuration Properties, are above CatLevel1 in the hierarchy. The Visual Studio categories do not count as part of the two levels. You do not return them from get_CategoryTitle.



    • Edited by BlackHC Thursday, September 11, 2008 2:06 PM
    • Proposed As Answer by BlackHC Thursday, September 11, 2008 2:06 PM
    • Marked As Answer by emaines Thursday, September 11, 2008 8:49 PM
    •  

All Replies

  • Thursday, September 11, 2008 2:01 PM
     
     Answered Has Code
    Hmm from the looks of it IVsPropertyPage could be the interface to implement in your property page class.
    Going to check that now.

    Yeah, it works.

    Implement IVsPropertyPage and then you can control the subcategories by implementing
    int CategoryTitle( 
        uint iLevel, 
        out string pbstrCategory 

    accordingly.

    From the help:

    If your property page does not have a category and you would prefer it to show on the top level of the tree view directly under the appropriate top-level category, then either implement IPropertyPage alone, or return E_NOTIMPL from this method.

    1. Otherwise, the environment first calls this method with an iLevel value of zero.

    2. You can then return the name of the category that should be the closest direct ancestor of this page in the tree.

    3. The environment will then call you with an iLevel value of one.

    4. If you want your page to be indented one level, then return S_FALSE.

    5. The environment continues to call this method, increasing the value of iLevel by one each time, until you return something other than S_OK, or you reach the environment's internal limit of what it supports.

    Returning E_NOTIMPL and S_FALSE stops processing without showing an error to the user. Any value other than S_OK can cause error information to be shown to the user.

    Currently the environment only supports two levels of categories:

    CatLevel1

    CatLevel0

    PageName

    The Visual Studio categories, Common Properties and Configuration Properties, are above CatLevel1 in the hierarchy. The Visual Studio categories do not count as part of the two levels. You do not return them from get_CategoryTitle.



    • Edited by BlackHC Thursday, September 11, 2008 2:06 PM
    • Proposed As Answer by BlackHC Thursday, September 11, 2008 2:06 PM
    • Marked As Answer by emaines Thursday, September 11, 2008 8:49 PM
    •  
  • Thursday, September 11, 2008 8:50 PM
     
     

    It works.

    Thanks!