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. New to MFC and have a few questions.

New to MFC and have a few questions.

Scheduled Pinned Locked Moved C / C++ / MFC
c++designagentic-aitutorialquestion
9 Posts 4 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.
  • R Offline
    R Offline
    Raskolnikov
    wrote on last edited by
    #1
    1. I know how to use the Add Member Variable Wizard to create a variable and associate it with a control, but how do you remove it? Currently I am forced to manually track down every reference to the variable in the code and remove it. A principle of good desing is that when ever you include an operation you should also include its opposite. If I can add the variable automatically I should also be able to remove or rename it automatically. So I am assuming that editing the source code is not the best method of removing a variable. Is there an Remove Member Variable Wizzard or something similar? 2) UpdateDate(TRUE/FALSE) WTF????? Was someone on crack when they came up with this. I just got done reading Code Complete published by Microsoft Press and this function violates just about every principle of good design. Specifically. a) Each function should have a single well defined purpose. UpdateData() is cleary two separate operations, UpDateData() and UpdateControls() shoved into the same function. b) The Function Name Should acurately describe everything the function does. A correct name would be UpdateDataOrUdateControls(); This is an ugly name but its an ugly function. c) Well written code is self documenting. UpdateData() and UpdateControls() have straight forward meanings. What does UpdateData(FALSE) mean. What was their reasoning? Am I missing something?
    J S C R 4 Replies Last reply
    0
    • R Raskolnikov
      1. I know how to use the Add Member Variable Wizard to create a variable and associate it with a control, but how do you remove it? Currently I am forced to manually track down every reference to the variable in the code and remove it. A principle of good desing is that when ever you include an operation you should also include its opposite. If I can add the variable automatically I should also be able to remove or rename it automatically. So I am assuming that editing the source code is not the best method of removing a variable. Is there an Remove Member Variable Wizzard or something similar? 2) UpdateDate(TRUE/FALSE) WTF????? Was someone on crack when they came up with this. I just got done reading Code Complete published by Microsoft Press and this function violates just about every principle of good design. Specifically. a) Each function should have a single well defined purpose. UpdateData() is cleary two separate operations, UpDateData() and UpdateControls() shoved into the same function. b) The Function Name Should acurately describe everything the function does. A correct name would be UpdateDataOrUdateControls(); This is an ugly name but its an ugly function. c) Well written code is self documenting. UpdateData() and UpdateControls() have straight forward meanings. What does UpdateData(FALSE) mean. What was their reasoning? Am I missing something?
      J Offline
      J Offline
      Jay Beckert
      wrote on last edited by
      #2

      Raskolnikov wrote: Is there an Remove Member Variable Wizzard or something similar? What version of VC aare you using? 6 or 7? I know with with VC6 you can use the class wizzard and select the variables tab you can delete your variables there. If you added a member variable your self you can use the class window. Right click and select delete. Raskolnikov wrote: c) Well written code is self documenting. UpdateData() and UpdateControls() have straight forward meanings. What does UpdateData(FALSE) mean. What was their reasoning? Am I missing something? Um, did they have any reasoning with that? :laugh: From my experience, it's best to not even bother with UpdateData() and just use control variables. It's just to much of a hassle IMO . Here's a good link that will explain better than what I could do. http://www.codeproject.com/cpp/avoidupdatedata.asp[^] Cheers :)

      R 1 Reply Last reply
      0
      • R Raskolnikov
        1. I know how to use the Add Member Variable Wizard to create a variable and associate it with a control, but how do you remove it? Currently I am forced to manually track down every reference to the variable in the code and remove it. A principle of good desing is that when ever you include an operation you should also include its opposite. If I can add the variable automatically I should also be able to remove or rename it automatically. So I am assuming that editing the source code is not the best method of removing a variable. Is there an Remove Member Variable Wizzard or something similar? 2) UpdateDate(TRUE/FALSE) WTF????? Was someone on crack when they came up with this. I just got done reading Code Complete published by Microsoft Press and this function violates just about every principle of good design. Specifically. a) Each function should have a single well defined purpose. UpdateData() is cleary two separate operations, UpDateData() and UpdateControls() shoved into the same function. b) The Function Name Should acurately describe everything the function does. A correct name would be UpdateDataOrUdateControls(); This is an ugly name but its an ugly function. c) Well written code is self documenting. UpdateData() and UpdateControls() have straight forward meanings. What does UpdateData(FALSE) mean. What was their reasoning? Am I missing something?
        S Offline
        S Offline
        Shog9 0
        wrote on last edited by
        #3

        Raskolnikov wrote: 2) UpdateDate(TRUE/FALSE) WTF????? Raskolnikov wrote: What was their reasoning? Am I missing something? Nope, MFC sucks hairy donkey balls. But, it used to be worse... And it's still better than nothing. (although you may want to give this new WTL thing a look; i've heard it sucks less)

        ---

        Shog9 If I could sleep forever, I could forget about everything...

        R 1 Reply Last reply
        0
        • R Raskolnikov
          1. I know how to use the Add Member Variable Wizard to create a variable and associate it with a control, but how do you remove it? Currently I am forced to manually track down every reference to the variable in the code and remove it. A principle of good desing is that when ever you include an operation you should also include its opposite. If I can add the variable automatically I should also be able to remove or rename it automatically. So I am assuming that editing the source code is not the best method of removing a variable. Is there an Remove Member Variable Wizzard or something similar? 2) UpdateDate(TRUE/FALSE) WTF????? Was someone on crack when they came up with this. I just got done reading Code Complete published by Microsoft Press and this function violates just about every principle of good design. Specifically. a) Each function should have a single well defined purpose. UpdateData() is cleary two separate operations, UpDateData() and UpdateControls() shoved into the same function. b) The Function Name Should acurately describe everything the function does. A correct name would be UpdateDataOrUdateControls(); This is an ugly name but its an ugly function. c) Well written code is self documenting. UpdateData() and UpdateControls() have straight forward meanings. What does UpdateData(FALSE) mean. What was their reasoning? Am I missing something?
          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4
          1. You should in any case learn to add and remove your own member variables. The wizard blows up from time to time, and if that is when you start trying to learn how to do things by hand, you'll be stuffed. 2) UpdateData is a screwy mechanism, as has been said. Do not use it. Christian We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
          R 1 Reply Last reply
          0
          • J Jay Beckert

            Raskolnikov wrote: Is there an Remove Member Variable Wizzard or something similar? What version of VC aare you using? 6 or 7? I know with with VC6 you can use the class wizzard and select the variables tab you can delete your variables there. If you added a member variable your self you can use the class window. Right click and select delete. Raskolnikov wrote: c) Well written code is self documenting. UpdateData() and UpdateControls() have straight forward meanings. What does UpdateData(FALSE) mean. What was their reasoning? Am I missing something? Um, did they have any reasoning with that? :laugh: From my experience, it's best to not even bother with UpdateData() and just use control variables. It's just to much of a hassle IMO . Here's a good link that will explain better than what I could do. http://www.codeproject.com/cpp/avoidupdatedata.asp[^] Cheers :)

            R Offline
            R Offline
            Raskolnikov
            wrote on last edited by
            #5

            Thanks, I will definately read that article.

            1 Reply Last reply
            0
            • S Shog9 0

              Raskolnikov wrote: 2) UpdateDate(TRUE/FALSE) WTF????? Raskolnikov wrote: What was their reasoning? Am I missing something? Nope, MFC sucks hairy donkey balls. But, it used to be worse... And it's still better than nothing. (although you may want to give this new WTL thing a look; i've heard it sucks less)

              ---

              Shog9 If I could sleep forever, I could forget about everything...

              R Offline
              R Offline
              Raskolnikov
              wrote on last edited by
              #6

              What is WTL, I might have to add it to my list of things to learn.

              S 1 Reply Last reply
              0
              • R Raskolnikov

                What is WTL, I might have to add it to my list of things to learn.

                S Offline
                S Offline
                Shog9 0
                wrote on last edited by
                #7

                http://www.codeproject.com/wtl/

                ---

                Shog9 If I could sleep forever, I could forget about everything...

                1 Reply Last reply
                0
                • C Christian Graus
                  1. You should in any case learn to add and remove your own member variables. The wizard blows up from time to time, and if that is when you start trying to learn how to do things by hand, you'll be stuffed. 2) UpdateData is a screwy mechanism, as has been said. Do not use it. Christian We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
                  R Offline
                  R Offline
                  Raskolnikov
                  wrote on last edited by
                  #8

                  I already fluent in C++ so manually adding and removing member variables is no problem, I was just looking for a more elegant solution. I will definately heed the warning about avoiding UpdataData. I think what happens with serialized API is all the bad design choices get propagated from one version to the next.

                  1 Reply Last reply
                  0
                  • R Raskolnikov
                    1. I know how to use the Add Member Variable Wizard to create a variable and associate it with a control, but how do you remove it? Currently I am forced to manually track down every reference to the variable in the code and remove it. A principle of good desing is that when ever you include an operation you should also include its opposite. If I can add the variable automatically I should also be able to remove or rename it automatically. So I am assuming that editing the source code is not the best method of removing a variable. Is there an Remove Member Variable Wizzard or something similar? 2) UpdateDate(TRUE/FALSE) WTF????? Was someone on crack when they came up with this. I just got done reading Code Complete published by Microsoft Press and this function violates just about every principle of good design. Specifically. a) Each function should have a single well defined purpose. UpdateData() is cleary two separate operations, UpDateData() and UpdateControls() shoved into the same function. b) The Function Name Should acurately describe everything the function does. A correct name would be UpdateDataOrUdateControls(); This is an ugly name but its an ugly function. c) Well written code is self documenting. UpdateData() and UpdateControls() have straight forward meanings. What does UpdateData(FALSE) mean. What was their reasoning? Am I missing something?
                    R Offline
                    R Offline
                    Raskolnikov
                    wrote on last edited by
                    #9

                    Any one know how to get to the "variables tab" in VC 7. The class wizard has gone missing and I want to be able to quickly delete (or better yet rename) misspelled variable without mucking with the source code.

                    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