Create category Header Files

Bryan Kelly 321 Reputation points
2022-08-13T20:53:49.88+00:00

Windows 11, VS 2019, C++
When some of the wxWidget sample solutions are opened the Solution Explorer has a category for header files.

230963-with-headers.png

When I start a project I don’t recognize the process to add header files in their own category

230907-without-headers.png

I have searched without success. What are the steps needed to add header files using that category?
Are there any tutorials that cover this and similar topics?

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,545 questions
{count} votes

4 additional answers

Sort by: Most helpful
  1. Bryan Kelly 321 Reputation points
    2022-08-13T22:13:12.477+00:00

    I had a difficult time getting started with wxWidgets. Over in their forums Doublemax and Oneeyeman helped me out and one gave me a starter solution in a zip file. It had a single .cpp file and no .h files. I copied it to a new directory and am trying to add new classes. They wind up in the Source Files and not in the Header files.

    0 comments No comments

  2. WayneAKing 4,921 Reputation points
    2022-08-13T23:40:49.487+00:00

    Just to expand a little on the suggestion from David:

    (1) In the solution which is not showing a category for
    Header files, right-click on the Project node.

    (2) Choose Add->New Filter and name it Header Files

    (3) In the Solution Explorer window, click on the
    Header Files node to give it focus.

    (4) Open or switch to the Properties window to see
    the Properties for this filter.

    (5) In the field labeled "Filter" put the extensions you want
    to have treated as Header Files. David gave one example. Here
    is another you can use:

    h;hh;hpp;hxx;hm;inl;inc;ipp;xsd

    (6) Now add a new header file to the project and see if it
    appears under Header Files in the Project tree in the
    Solution Explorer window.

    • Wayne
    0 comments No comments

  3. Bryan Kelly 321 Reputation points
    2022-08-14T02:35:59.257+00:00

    (1) In the solution which is not showing a category for
    Header files, right-click on the Project node.
    OK

    (2) Choose Add->New Filter and name it Header Files
    OK, have the new section

    (3) In the Solution Explorer window, click on the Header Files node to give it focus.
    Highlighted

    (4) Open or switch to the Properties window to see the Properties for this filter.

    Right click on Header Files -> Properties and dialog says there are no property pages. Options only for OK and Cancel.

    With Header Files highlighted select Project -> Properties to get the same dialog.
    What am I not recognizing?

    0 comments No comments

  4. Bryan Kelly 321 Reputation points
    2022-08-14T15:19:35.147+00:00

    The alt-Enter keystroke opened the necessary dialog.
    Neither of the two options starting with View helped.
    After setting those properties, the .h file was click and dragged to its new home and looks better now.
    Thank you for your time.