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. Too many variables !?!

Too many variables !?!

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
11 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.
  • N Offline
    N Offline
    nencini
    wrote on last edited by
    #1

    It's the first time that I work with MFC Appwizard(exe) with many member variables on the screen, and when I reach a certain number of "add variables", the program compile well, but when I try to execute it CRASH. Somebody can tell me how to avoid this? - Yhanks.

    C 1 Reply Last reply
    0
    • N nencini

      It's the first time that I work with MFC Appwizard(exe) with many member variables on the screen, and when I reach a certain number of "add variables", the program compile well, but when I try to execute it CRASH. Somebody can tell me how to avoid this? - Yhanks.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      How many variables do you have ? I doubt this is the problem. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

      N 1 Reply Last reply
      0
      • C Christian Graus

        How many variables do you have ? I doubt this is the problem. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

        N Offline
        N Offline
        nencini
        wrote on last edited by
        #3

        I've about 30 variables, and this is not the first time I work with MFC Appwizard(exe). What a sympatic fellow is Larry Antram 22 Oct 2002 !!

        C R 2 Replies Last reply
        0
        • N nencini

          I've about 30 variables, and this is not the first time I work with MFC Appwizard(exe). What a sympatic fellow is Larry Antram 22 Oct 2002 !!

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          nencini wrote: I've about 30 variables Am if you remove some, does it work ? Have you used the debugger to see where it crashes ? I guarentee that it's not an upper variable limit you're hitting, unless you've got no HDD space for virtual memory and they are each 1600x1200x32 bit images. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

          N 1 Reply Last reply
          0
          • C Christian Graus

            nencini wrote: I've about 30 variables Am if you remove some, does it work ? Have you used the debugger to see where it crashes ? I guarentee that it's not an upper variable limit you're hitting, unless you've got no HDD space for virtual memory and they are each 1600x1200x32 bit images. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

            N Offline
            N Offline
            nencini
            wrote on last edited by
            #5

            Unfortunately I think that the debugger can't help me, because there are not error in compiling. The crash only happen when I execute, with the message "This program has executed an invalid opratione and willl be teminated" . If I remove some variables - of various type - (now I can't say how many) all is going well. I've never used the debugger, and I read alwais the error message that appears on the output pane.

            C 1 Reply Last reply
            0
            • N nencini

              Unfortunately I think that the debugger can't help me, because there are not error in compiling. The crash only happen when I execute, with the message "This program has executed an invalid opratione and willl be teminated" . If I remove some variables - of various type - (now I can't say how many) all is going well. I've never used the debugger, and I read alwais the error message that appears on the output pane.

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              nencini wrote: I've never used the debugger, and I read alwais the error message that appears on the output pane. Apparently not. The debugger is ONLY of use if your code compiles. Use F9 to set a breakpoint, make sure you're building a debug version, and hit F5 to start debugging. Your program will stop at your break point and you can step through the code by hitting F10, and see the values of your variables in the watch window. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

              N 1 Reply Last reply
              0
              • C Christian Graus

                nencini wrote: I've never used the debugger, and I read alwais the error message that appears on the output pane. Apparently not. The debugger is ONLY of use if your code compiles. Use F9 to set a breakpoint, make sure you're building a debug version, and hit F5 to start debugging. Your program will stop at your break point and you can step through the code by hitting F10, and see the values of your variables in the watch window. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

                N Offline
                N Offline
                nencini
                wrote on last edited by
                #7

                Well, I'm not so expert in VC++ as you think. I've activate the debugger, and appea the window "Unhandled exception in xxx.exe 0xC0000005. Access violation" and the code stop at the statement m_pMainWnd = &dlg; The problem is that I don't Know what this means !!!! I'm on the Titanic ship and I scream "HELP!!!!"

                C M 2 Replies Last reply
                0
                • N nencini

                  Well, I'm not so expert in VC++ as you think. I've activate the debugger, and appea the window "Unhandled exception in xxx.exe 0xC0000005. Access violation" and the code stop at the statement m_pMainWnd = &dlg; The problem is that I don't Know what this means !!!! I'm on the Titanic ship and I scream "HELP!!!!"

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  Is this an MFC app, or Win32 ? Is the line written by you, or the wizard ? What is the value of &dlg ? Is dlg a global, or is the pointer being stored about to belong to an object that has been destroyed ( when dlg goes out of scope ) ??? Not to be rude, but how long have you been using VC ? Do you have a specific project you need to get done, or are you a student ? I have no trouble helping you if you're studying, but I just want to know what your long term goal is so I can suggest some resources to help you understand what is going on here. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

                  1 Reply Last reply
                  0
                  • N nencini

                    I've about 30 variables, and this is not the first time I work with MFC Appwizard(exe). What a sympatic fellow is Larry Antram 22 Oct 2002 !!

                    R Offline
                    R Offline
                    Rickard Andersson20
                    wrote on last edited by
                    #9

                    nencini wrote: about 30 variables How are you using them? Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!

                    1 Reply Last reply
                    0
                    • N nencini

                      Well, I'm not so expert in VC++ as you think. I've activate the debugger, and appea the window "Unhandled exception in xxx.exe 0xC0000005. Access violation" and the code stop at the statement m_pMainWnd = &dlg; The problem is that I don't Know what this means !!!! I'm on the Titanic ship and I scream "HELP!!!!"

                      M Offline
                      M Offline
                      Michael P Butler
                      wrote on last edited by
                      #10

                      It sounds like you have a Dialog App that is failing to create the dlg for some reason. Are you using some specialist controls on the dialog or have you assigned variables to controls you have later removed from the resource. Sooner or later you are going to need to learn the art of debugging, you need to put a breakpoint at the beginning of the InitInstance function of your WinApp derived class and step (F11) into each function until you spot something going wrong. If you post a portion of the dialog code that is going wrong, somebody here might be able to point you in the right direction. Michael Life’s not a song. Life isn’t bliss. Life is just this. It’s living. -- Buffy the Vampire Slayer: Once more, with feeling

                      N 1 Reply Last reply
                      0
                      • M Michael P Butler

                        It sounds like you have a Dialog App that is failing to create the dlg for some reason. Are you using some specialist controls on the dialog or have you assigned variables to controls you have later removed from the resource. Sooner or later you are going to need to learn the art of debugging, you need to put a breakpoint at the beginning of the InitInstance function of your WinApp derived class and step (F11) into each function until you spot something going wrong. If you post a portion of the dialog code that is going wrong, somebody here might be able to point you in the right direction. Michael Life’s not a song. Life isn’t bliss. Life is just this. It’s living. -- Buffy the Vampire Slayer: Once more, with feeling

                        N Offline
                        N Offline
                        nencini
                        wrote on last edited by
                        #11

                        Yes, may be that I've assigned variables to controls and later removed from the resource!!! (Is that a problem ????). The debugger say that there are problems on the global theApp here: BOOL CVivoliApp::InitInstance() #ifdef _AFXDLL Enable3dControls(); #else Enable3dControlsStatic(); #endif CVivoliDlg dlg; --->> m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // ,,,,,,,, } else if (nResponse == IDCANCEL) { // ...... } }

                        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