Check Failure #2 stack around a variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nabil035
    New Member
    • Mar 2008
    • 34

    Check Failure #2 stack around a variable

    I have this error around a variable named "value" in a huge code of 54000 lines (DLL)and I cannot debug it

    I have in my code more than 100 different declarations of "value" so I want to know how to debug my code!!?

    I have done the classic option offered by VS2005 where I reference a client to my application which is a COM server but the client doesn't see the new DLL!!!

    please if u have any idea or a beginning of a solution don't hesitate to reply!!!
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by nabil035
    I have this error around a variable named "value" in a huge code of 54000 lines (DLL)and I cannot debug it

    I have in my code more than 100 different declarations of "value" so I want to know how to debug my code!!?

    I have done the classic option offered by VS2005 where I reference a client to my application which is a COM server but the client doesn't see the new DLL!!!

    please if u have any idea or a beginning of a solution don't hesitate to reply!!!
    Not knowing too much about your code, I usually start with cout statements all around it and leading up to it - including variables I'm not looking at. You can find some pretty interesting things, get a very good idea of what your program is doing by putting cout statements after every line and printing out your variables.

    Comment

    • nabil035
      New Member
      • Mar 2008
      • 34

      #3
      Thx I know very welle what my program is doing but I cannot locate the "value"

      I should debug my project

      it's the unique solution I thnik

      but how !! :(

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        Originally posted by nabil035
        I have in my code more than 100 different declarations of "value" so I want to know how to debug my code!!?
        That's your issue right there. Why are you declaring it over 100 times? Why not just declare it once?

        PS - compiler errors usually include line numbers. That's the variant it doesn't like.
        Last edited by sicarie; Mar 11 '08, 02:35 PM. Reason: PS

        Comment

        • nabil035
          New Member
          • Mar 2008
          • 34

          #5
          well it's a mistake but now I want to learn how to DEBUG a COM server

          in fact I know how by giving as input the client but this dosen't work for my client
          he seeks for the DLL in the same folder
          please help!!!

          Comment

          • nabil035
            New Member
            • Mar 2008
            • 34

            #6
            does anyone know how to DEBUG please!!!

            I cannot continue with putting messagebox everywhere in my code

            any idea or beginning of solution will be helpful

            Comment

            • nabil035
              New Member
              • Mar 2008
              • 34

              #7
              well the problem is resolved, in 2 days this is so much

              if i have debuged it, I would resolve it in a half of an hour

              thx anyway ;)

              Comment

              • weaknessforcats
                Recognized Expert Expert
                • Mar 2007
                • 9214

                #8
                Originally posted by nabil035
                if i have debuged it, I would resolve it in a half of an hour
                Do you not know how to use your debugger?

                I assume you have debug builds for the COM server.

                You should just be able to step into the code.

                Comment

                • nabil035
                  New Member
                  • Mar 2008
                  • 34

                  #9
                  what did u mean by DEBUG builds??

                  Comment

                  • weaknessforcats
                    Recognized Expert Expert
                    • Mar 2007
                    • 9214

                    #10
                    I mean that in order to use your debugger, there has to be code inside your executable to operate it.

                    Visual Studio.NET has two type of builds a release build and a debug build.

                    The debug build has the code required to operate the debugger. So, you make a debug build (usually larger in size because of this debugger code) and use the debugger to debug the program. Then, you make a release build for distribution to your customers.

                    Therefore, to debug into a DLL you need debug version of that DLL. Usually the debug version is the same name as the release version but has a "d" as the last letter. You need to be sure that all parts of the program are debug builds if you want your debugger to work.

                    Microsoft even provides a debug build of the operating system for driver writers. Here you need to sign a non-disclosure agreement since the debug build lets you see all of the source code.

                    Comment

                    • nabil035
                      New Member
                      • Mar 2008
                      • 34

                      #11
                      thx

                      but it's not sufficient that I put the DEBUG option only in the general propoerties of my VS2005 project??

                      I think that it will understand that all the code is Debug build

                      :(

                      the problem persist, cuz I have new problems in my code, I need to debug it

                      could any one help please!!!!

                      Comment

                      • weaknessforcats
                        Recognized Expert Expert
                        • Mar 2007
                        • 9214

                        #12
                        In VS2005, go to the configuration manager and set the debug build for your project there.

                        Then, make sure all of the libraries for linker input are also debug versions.

                        Then build.

                        Your debugger should be able to step into the dll code.

                        I don't know what you mean about setting DEBUG in your projetc general properties sicne there is no place to sset that. The only DEBUG I know about is _DEBUG that is used in the preprocessor settings when making a debug build.

                        Comment

                        Working...