Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Classwizard / add member function

Classwizard / add member function

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moliate
    wrote on last edited by
    #1

    Is there any way to "tweak" the output of the classwizard? What I want to do is add some Doxygen comments on "new class", "add member function" and so on. For example, adding a new function does something like this (header):

    void myFunc(int hello);

    while I would prefer this:

    /*! \fn void myFunc(int hello)
    * myFunc description
    * \param hello
    * \return
    */
    void myFunc(int hello);

    Right now I am using a very ugly macro, that does not work very well. Can this be done in a simple way? Thanks /moliate

    B 1 Reply Last reply
    0
    • M moliate

      Is there any way to "tweak" the output of the classwizard? What I want to do is add some Doxygen comments on "new class", "add member function" and so on. For example, adding a new function does something like this (header):

      void myFunc(int hello);

      while I would prefer this:

      /*! \fn void myFunc(int hello)
      * myFunc description
      * \param hello
      * \return
      */
      void myFunc(int hello);

      Right now I am using a very ugly macro, that does not work very well. Can this be done in a simple way? Thanks /moliate

      B Offline
      B Offline
      Ben Burnett
      wrote on last edited by
      #2

      You should consider beatifying your macro, because modifying the class wizard to do your bidding won’t work. I tried doing something similar a few years back, and I ran into several problems: 1) The resource used to write the function implementation is the same one used to write the declaration. Meaning that you would get duplicates of any additions you make, one in the *.h file and the same in the *.cpp file. Also the one added to the *.h will have to be manually removed, as it messes with the class wizards parser. 2) The resource ‘script’ parser is not very advanced. It simply grabs the stuff out of the reswource string line-by-line without doing any validation. Take for example the following WM_SIZE handler resource; 1: OnSize 2: void 3: UINT nType, int cx, int cy 4: %1::%2(nType, cx, cy); 5: 6: %4 Add your message handler code here Line 1 is used to name the handler, and as the display string in the class wizard. Line 2 is the return type Line 3 is the handler’s parameter list Line 4 generates code that calls the handler’s base class Line 5 adds a blank line to the code Line 6 is that stupid comment you delete instantly So, you could add your comment into line 2, but you’d have to enter it all on the one line. Then once you used the class wizard to inserted it, you’d have to delete the comment out of the *.h (so that you don’t confuse the class wizard’s parser) and then format the comment in the *.cpp. If your still interested in taking a look at all of this stuff just look for the MFCCLWZ.DLL file in your Visual Studio installation directory under “Common\MSDev98\Bin”. It’s all in there, under the "STRINGARRAY" resource type. cheers, -Ben

      M 1 Reply Last reply
      0
      • B Ben Burnett

        You should consider beatifying your macro, because modifying the class wizard to do your bidding won’t work. I tried doing something similar a few years back, and I ran into several problems: 1) The resource used to write the function implementation is the same one used to write the declaration. Meaning that you would get duplicates of any additions you make, one in the *.h file and the same in the *.cpp file. Also the one added to the *.h will have to be manually removed, as it messes with the class wizards parser. 2) The resource ‘script’ parser is not very advanced. It simply grabs the stuff out of the reswource string line-by-line without doing any validation. Take for example the following WM_SIZE handler resource; 1: OnSize 2: void 3: UINT nType, int cx, int cy 4: %1::%2(nType, cx, cy); 5: 6: %4 Add your message handler code here Line 1 is used to name the handler, and as the display string in the class wizard. Line 2 is the return type Line 3 is the handler’s parameter list Line 4 generates code that calls the handler’s base class Line 5 adds a blank line to the code Line 6 is that stupid comment you delete instantly So, you could add your comment into line 2, but you’d have to enter it all on the one line. Then once you used the class wizard to inserted it, you’d have to delete the comment out of the *.h (so that you don’t confuse the class wizard’s parser) and then format the comment in the *.cpp. If your still interested in taking a look at all of this stuff just look for the MFCCLWZ.DLL file in your Visual Studio installation directory under “Common\MSDev98\Bin”. It’s all in there, under the "STRINGARRAY" resource type. cheers, -Ben

        M Offline
        M Offline
        moliate
        wrote on last edited by
        #3

        Thanks for the clarification on how mfcclwz.dll is organized. I have fired up ResHacker and started looking at it. You are probably right about it being simpler writing a better macro, but it is nice to get a better understanding on how the classwizard works! Cheers /moliate

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups