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. Problem while switching from debugging mode to release mode

Problem while switching from debugging mode to release mode

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsdebugginghelptutorialquestion
14 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.
  • S Sangeetha_J

    Hi Naveen, I learnt one article to debug even in release mode. i tried it. While am debugging and then seeing the output it is correct in release mode also. But without debugging in release mode, the output is not as expected. But its different. And i tried your suggestion also. The same problem still exists.

    With Regards, Sangeetha.

    N Offline
    N Offline
    Naveen
    wrote on last edited by
    #4

    I hardly doubt this is because of some uninitialized varaiables. Are you using CRect or some thing like that? Paste the code. I will try to find.

    nave [OpenedFileFinder]

    S 1 Reply Last reply
    0
    • N Naveen

      I hardly doubt this is because of some uninitialized varaiables. Are you using CRect or some thing like that? Paste the code. I will try to find.

      nave [OpenedFileFinder]

      S Offline
      S Offline
      Sangeetha_J
      wrote on last edited by
      #5

      void CDocumentationView::BottomLayerView() { float div = 1000; float X1 = 0.000, Y1 = 0.000, X2 = 0.000, Y2 = 0.0; float XCen = 0.0, YCen = 0.0, wid = 0.0, hei = 0.0, dia = 0.0, rad = 0.0; BYTE Red = 0, Green = 0, Blue = 0; int size = FootPrintArray.GetSize(); for(int inc = 0; inc < size; inc++) { FootPrint* foot = (FootPrint*) FootPrintArray.GetAt(inc); if(foot -> color != 0) { m_color = foot -> color; Red = ((BYTE*)(&m_color))[0]; Green = ((BYTE*)(&m_color))[1]; Blue = ((BYTE*)(&m_color))[2]; int no = foot -> RefDes.GetSize(); CString temppinno = "\0"; float XStart = 0.0, YStart = 0.0; int pinnos = 0; glColor3ub(Red, Green, Blue); for(int incval = 0; incval < no; incval++) { CColoringComp* component = (CColoringComp*) foot -> RefDes.GetAt(incval); int pinno = component -> PinArray.GetSize(); for(int incval1 = 0; incval1 < pinno; incval1++) { CPinDetails* pin = (CPinDetails*) component -> PinArray.GetAt(incval1); int graphicno = pin -> GraphicData.GetSize(); for(int incval2 = 0; incval2 < graphicno; incval2++) { if(pin -> Mirror == "YES") { CGraphic* graphicdata = (CGraphic*) pin -> GraphicData.GetAt(incval2); if(graphicdata -> number <= 255) { XCen = graphicdata -> Data1; if(Mirrored) XCen = -(graphicdata -> Data1); YCen = graphicdata -> Data2; wid = graphicdata -> Data3; hei = graphicdata -> Data4; dia = graphicdata -> Data3; if(INCH == true) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); } else if(MILLIMETER == TRUE) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); wid = (GLfloat) (wid * 25.4); hei = (GLfloat) (hei * 25.4); dia = (GLfloat) (dia * 25.4); XCen = (GLfloat) (XCen * 25.4); YCen = (GLfloat) (YCen * 25.4); } if( (graphicdata -> Name.Find("RECTANGLE", 0) != -1) || (graphicdata -> Name.Find("SQUARE", 0) != -1) || (g

      N D 2 Replies Last reply
      0
      • S Sangeetha_J

        void CDocumentationView::BottomLayerView() { float div = 1000; float X1 = 0.000, Y1 = 0.000, X2 = 0.000, Y2 = 0.0; float XCen = 0.0, YCen = 0.0, wid = 0.0, hei = 0.0, dia = 0.0, rad = 0.0; BYTE Red = 0, Green = 0, Blue = 0; int size = FootPrintArray.GetSize(); for(int inc = 0; inc < size; inc++) { FootPrint* foot = (FootPrint*) FootPrintArray.GetAt(inc); if(foot -> color != 0) { m_color = foot -> color; Red = ((BYTE*)(&m_color))[0]; Green = ((BYTE*)(&m_color))[1]; Blue = ((BYTE*)(&m_color))[2]; int no = foot -> RefDes.GetSize(); CString temppinno = "\0"; float XStart = 0.0, YStart = 0.0; int pinnos = 0; glColor3ub(Red, Green, Blue); for(int incval = 0; incval < no; incval++) { CColoringComp* component = (CColoringComp*) foot -> RefDes.GetAt(incval); int pinno = component -> PinArray.GetSize(); for(int incval1 = 0; incval1 < pinno; incval1++) { CPinDetails* pin = (CPinDetails*) component -> PinArray.GetAt(incval1); int graphicno = pin -> GraphicData.GetSize(); for(int incval2 = 0; incval2 < graphicno; incval2++) { if(pin -> Mirror == "YES") { CGraphic* graphicdata = (CGraphic*) pin -> GraphicData.GetAt(incval2); if(graphicdata -> number <= 255) { XCen = graphicdata -> Data1; if(Mirrored) XCen = -(graphicdata -> Data1); YCen = graphicdata -> Data2; wid = graphicdata -> Data3; hei = graphicdata -> Data4; dia = graphicdata -> Data3; if(INCH == true) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); } else if(MILLIMETER == TRUE) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); wid = (GLfloat) (wid * 25.4); hei = (GLfloat) (hei * 25.4); dia = (GLfloat) (dia * 25.4); XCen = (GLfloat) (XCen * 25.4); YCen = (GLfloat) (YCen * 25.4); } if( (graphicdata -> Name.Find("RECTANGLE", 0) != -1) || (graphicdata -> Name.Find("SQUARE", 0) != -1) || (g

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #6

        :doh:

        nave [OpenedFileFinder]

        S 1 Reply Last reply
        0
        • N Naveen

          :doh:

          nave [OpenedFileFinder]

          S Offline
          S Offline
          Sangeetha_J
          wrote on last edited by
          #7

          Hi Naveen, What happened? Is my code confusing?

          With Regards, Sangeetha.

          N A 2 Replies Last reply
          0
          • S Sangeetha_J

            Hi Naveen, What happened? Is my code confusing?

            With Regards, Sangeetha.

            N Offline
            N Offline
            Naveen
            wrote on last edited by
            #8

            Sorry thats a lot of code.. also i havent used opengl yet.Is your whole drawing moving to some other place or only some perticular drawings. Other way to debug is using the OutputDebugString() function. you can watch the output using the DebugView[^]. So what am telling is that output your x and y coordinates to the debug view and check whether it is correct or not.

            nave [OpenedFileFinder]

            S 2 Replies Last reply
            0
            • N Naveen

              Sorry thats a lot of code.. also i havent used opengl yet.Is your whole drawing moving to some other place or only some perticular drawings. Other way to debug is using the OutputDebugString() function. you can watch the output using the DebugView[^]. So what am telling is that output your x and y coordinates to the debug view and check whether it is correct or not.

              nave [OpenedFileFinder]

              S Offline
              S Offline
              Sangeetha_J
              wrote on last edited by
              #9

              Okay.. I will check.. And let u know the result soon.. Please check the forum periodically by tomorrow.. please excuse me to say this.

              With Regards, Sangeetha.

              N 1 Reply Last reply
              0
              • S Sangeetha_J

                Okay.. I will check.. And let u know the result soon.. Please check the forum periodically by tomorrow.. please excuse me to say this.

                With Regards, Sangeetha.

                N Offline
                N Offline
                Naveen
                wrote on last edited by
                #10

                Sangeetha_J wrote:

                Please check the forum periodically by tomorrow

                okey

                nave [OpenedFileFinder]

                1 Reply Last reply
                0
                • S Sangeetha_J

                  void CDocumentationView::BottomLayerView() { float div = 1000; float X1 = 0.000, Y1 = 0.000, X2 = 0.000, Y2 = 0.0; float XCen = 0.0, YCen = 0.0, wid = 0.0, hei = 0.0, dia = 0.0, rad = 0.0; BYTE Red = 0, Green = 0, Blue = 0; int size = FootPrintArray.GetSize(); for(int inc = 0; inc < size; inc++) { FootPrint* foot = (FootPrint*) FootPrintArray.GetAt(inc); if(foot -> color != 0) { m_color = foot -> color; Red = ((BYTE*)(&m_color))[0]; Green = ((BYTE*)(&m_color))[1]; Blue = ((BYTE*)(&m_color))[2]; int no = foot -> RefDes.GetSize(); CString temppinno = "\0"; float XStart = 0.0, YStart = 0.0; int pinnos = 0; glColor3ub(Red, Green, Blue); for(int incval = 0; incval < no; incval++) { CColoringComp* component = (CColoringComp*) foot -> RefDes.GetAt(incval); int pinno = component -> PinArray.GetSize(); for(int incval1 = 0; incval1 < pinno; incval1++) { CPinDetails* pin = (CPinDetails*) component -> PinArray.GetAt(incval1); int graphicno = pin -> GraphicData.GetSize(); for(int incval2 = 0; incval2 < graphicno; incval2++) { if(pin -> Mirror == "YES") { CGraphic* graphicdata = (CGraphic*) pin -> GraphicData.GetAt(incval2); if(graphicdata -> number <= 255) { XCen = graphicdata -> Data1; if(Mirrored) XCen = -(graphicdata -> Data1); YCen = graphicdata -> Data2; wid = graphicdata -> Data3; hei = graphicdata -> Data4; dia = graphicdata -> Data3; if(INCH == true) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); } else if(MILLIMETER == TRUE) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); wid = (GLfloat) (wid * 25.4); hei = (GLfloat) (hei * 25.4); dia = (GLfloat) (dia * 25.4); XCen = (GLfloat) (XCen * 25.4); YCen = (GLfloat) (YCen * 25.4); } if( (graphicdata -> Name.Find("RECTANGLE", 0) != -1) || (graphicdata -> Name.Find("SQUARE", 0) != -1) || (g

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #11

                  Do you seriously think that anyone is going to wade through all of this? :rolleyes:


                  "A good athlete is the result of a good and worthy opponent." - David Crow

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  1 Reply Last reply
                  0
                  • N Naveen

                    Sorry thats a lot of code.. also i havent used opengl yet.Is your whole drawing moving to some other place or only some perticular drawings. Other way to debug is using the OutputDebugString() function. you can watch the output using the DebugView[^]. So what am telling is that output your x and y coordinates to the debug view and check whether it is correct or not.

                    nave [OpenedFileFinder]

                    S Offline
                    S Offline
                    Sangeetha_J
                    wrote on last edited by
                    #12

                    Hi Naveen, CRect is there is another function

                    With Regards, Sangeetha.

                    1 Reply Last reply
                    0
                    • S Sangeetha_J

                      Hi Naveen, What happened? Is my code confusing?

                      With Regards, Sangeetha.

                      A Offline
                      A Offline
                      Ahmad_Hassan
                      wrote on last edited by
                      #13

                      If you are dealing with graphics ... there may be problem of object leaking. You can verify it by enabling GDI option in task manager and then running your code. May help you :).

                      --------------------------------- I cant lose any thing ... because I have nothing to lose.

                      1 Reply Last reply
                      0
                      • N Naveen

                        May be you have left some variables uninitialized. why dont you try debugging...

                        nave [OpenedFileFinder]

                        S Offline
                        S Offline
                        Sangeetha_J
                        wrote on last edited by
                        #14

                        Hi, Thanks for all.. And thank you very much Naveen for telling me about Debug View. I found out that the problem is with the format change of a statement in my input file using the debug view. And solved it.

                        With Regards, Sangeetha.

                        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