C++ Class diagram

Sysprogs forums Forums VisualGDB C++ Class diagram

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #33511
    GeneM
    Participant

    I’m able to create a class diagram with VS and C# which winds up being pretty useful.  I don’t seem to be able to do that with VisualGDB for an embedded C++ CMake project in VS2017 Community Edition.  I installed the class designer component per the MS instructions and can see the class designer in a Windows Desktop project when I click on the project in the solution explorer and add new item.  But it doesn’t show up in the list of new items I can add to my C++ project.  Is there a way to create a class diagram with the standard VS tool or any other tool?

    And a different question: Is there a compelling reason to upgrade to a newer VS Community edition? 2019 or ???

    Thanks

    • This topic was modified 2 years ago by GeneM.
    #33517
    support
    Keymaster

    Hi,

    Indeed, the VisualGDB CMake projects use a different template mechanism, so it allows adding targets or individual source files, but not whole classes. As a workaround, please consider adding a pair of .cpp and .h files and declaring a class there manually. You can then rely on VisualGDB’s IntelliSense to generate most redundant code for you:

    • Once you type in the constructor declaration (e.g. ‘MyClass();’), press Ctrl+. and select “Create a definition”. It will insert the “MyClass::MyClass() {}” part in the .cpp file
    • Whenever you want to add a new method to the class, you can try just calling it from the code as if it was there, and then use the “Create from use” command, that will determine the names and types of the arguments based on the values you passed.

    Regarding the Visual Studio versions, VisualGDB replaces a lot of the Visual Studio GUI and functionality with its own implementations, and the parts that are not replaced (tab docking, breakpoint/watch GUI), have not changed much between VS2017 and VS2022. On the other hand, VS2019 and VS2022 feature a lot of improvements for the C# development, so if you are occasionally developing C# code, it could be worthwhile checking them out.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.