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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Exception in Release mode??

Exception in Release mode??

Scheduled Pinned Locked Moved C#
questionvisual-studiographicsdebugginghelp
13 Posts 7 Posters 1 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.
  • Z Offline
    Z Offline
    zubair_ahmed
    wrote on last edited by
    #1

    A block of code is giving exception in Release mode--outside VS, but not in debug mode. Can you please tell what is the problem with my this method? How can i track the exception? Its running properly in the debug but i don't know what goes wrong in the Release mode. int i = 0; int res = BAD_RESULT; try { vector parts; if (m_pDoc->doGetPartDiameters(parts)) { for(i = 0; i < parts.size(); i++) { if (parts[i].PartDiameterLUT < 10.0 ) PartDiameterLUT[i]= 10.0; if (parts[i].PartDiameterLUT > 120.0) PartDiameterLUT[i]= 120.0; if (parts[i].RetractDistInches < 0.0) RetractDistInchesLUT[i]= 0.0; if (parts[i].RetractDistInches < 40.0) RetractDistInchesLUT[i]= 40.0; if (parts[i].JointTypeLUT < 0) JointTypeLUT[i]=(JointMode)0; if (parts[i].JointTypeLUT > 3) JointTypeLUT[i ]=(JointMode)0 ; } res = GOOD_RESULT; AfxMessageBox("GOOD_RESULT"); } else { AfxMessageBox("Part Diameter Data could not be loaded1"); return BAD_RESULT; } } catch(...) { AfxMessageBox("HERE IS THE EXCEPTION THAT IS THROWN"); return BAD_RESULT; } return res; } // LoadDiameterLUT

    Z.A

    C L 2 Replies Last reply
    0
    • Z zubair_ahmed

      A block of code is giving exception in Release mode--outside VS, but not in debug mode. Can you please tell what is the problem with my this method? How can i track the exception? Its running properly in the debug but i don't know what goes wrong in the Release mode. int i = 0; int res = BAD_RESULT; try { vector parts; if (m_pDoc->doGetPartDiameters(parts)) { for(i = 0; i < parts.size(); i++) { if (parts[i].PartDiameterLUT < 10.0 ) PartDiameterLUT[i]= 10.0; if (parts[i].PartDiameterLUT > 120.0) PartDiameterLUT[i]= 120.0; if (parts[i].RetractDistInches < 0.0) RetractDistInchesLUT[i]= 0.0; if (parts[i].RetractDistInches < 40.0) RetractDistInchesLUT[i]= 40.0; if (parts[i].JointTypeLUT < 0) JointTypeLUT[i]=(JointMode)0; if (parts[i].JointTypeLUT > 3) JointTypeLUT[i ]=(JointMode)0 ; } res = GOOD_RESULT; AfxMessageBox("GOOD_RESULT"); } else { AfxMessageBox("Part Diameter Data could not be loaded1"); return BAD_RESULT; } } catch(...) { AfxMessageBox("HERE IS THE EXCEPTION THAT IS THROWN"); return BAD_RESULT; } return res; } // LoadDiameterLUT

      Z.A

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

      Dude - this is the C# forum. This code is C++/MFC.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      1 Reply Last reply
      0
      • Z zubair_ahmed

        A block of code is giving exception in Release mode--outside VS, but not in debug mode. Can you please tell what is the problem with my this method? How can i track the exception? Its running properly in the debug but i don't know what goes wrong in the Release mode. int i = 0; int res = BAD_RESULT; try { vector parts; if (m_pDoc->doGetPartDiameters(parts)) { for(i = 0; i < parts.size(); i++) { if (parts[i].PartDiameterLUT < 10.0 ) PartDiameterLUT[i]= 10.0; if (parts[i].PartDiameterLUT > 120.0) PartDiameterLUT[i]= 120.0; if (parts[i].RetractDistInches < 0.0) RetractDistInchesLUT[i]= 0.0; if (parts[i].RetractDistInches < 40.0) RetractDistInchesLUT[i]= 40.0; if (parts[i].JointTypeLUT < 0) JointTypeLUT[i]=(JointMode)0; if (parts[i].JointTypeLUT > 3) JointTypeLUT[i ]=(JointMode)0 ; } res = GOOD_RESULT; AfxMessageBox("GOOD_RESULT"); } else { AfxMessageBox("Part Diameter Data could not be loaded1"); return BAD_RESULT; } } catch(...) { AfxMessageBox("HERE IS THE EXCEPTION THAT IS THROWN"); return BAD_RESULT; } return res; } // LoadDiameterLUT

        Z.A

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        zubair_ahmed wrote:

        catch(...) { AfxMessageBox("HERE IS THE EXCEPTION THAT IS THROWN"); return BAD_RESULT; }

        Dude - if you catch an exception look at it instead of replacing it by a meaningless constant string.

        Luc Pattyn [My Articles] [Forum Guidelines]

        C 1 Reply Last reply
        0
        • L Luc Pattyn

          zubair_ahmed wrote:

          catch(...) { AfxMessageBox("HERE IS THE EXCEPTION THAT IS THROWN"); return BAD_RESULT; }

          Dude - if you catch an exception look at it instead of replacing it by a meaningless constant string.

          Luc Pattyn [My Articles] [Forum Guidelines]

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

          His code is C++, he doesn't get a meaningful exception object.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          L 1 Reply Last reply
          0
          • C Christian Graus

            His code is C++, he doesn't get a meaningful exception object.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            That's too bad.

            Luc Pattyn [My Articles] [Forum Guidelines]

            Z 1 Reply Last reply
            0
            • L Luc Pattyn

              That's too bad.

              Luc Pattyn [My Articles] [Forum Guidelines]

              Z Offline
              Z Offline
              zappingz
              wrote on last edited by
              #6

              could be a dll problem

              Z 1 Reply Last reply
              0
              • Z zappingz

                could be a dll problem

                Z Offline
                Z Offline
                zappingz
                wrote on last edited by
                #7

                are you using source safe for the project?

                Z 1 Reply Last reply
                0
                • Z zappingz

                  are you using source safe for the project?

                  Z Offline
                  Z Offline
                  zappingz
                  wrote on last edited by
                  #8

                  the folder could be in read only mode.

                  Z 1 Reply Last reply
                  0
                  • Z zappingz

                    the folder could be in read only mode.

                    Z Offline
                    Z Offline
                    zappingz
                    wrote on last edited by
                    #9

                    could also be a rights problem

                    Z M 2 Replies Last reply
                    0
                    • Z zappingz

                      could also be a rights problem

                      Z Offline
                      Z Offline
                      zappingz
                      wrote on last edited by
                      #10

                      Which version of .net are you trying it on?

                      C D 2 Replies Last reply
                      0
                      • Z zappingz

                        could also be a rights problem

                        M Offline
                        M Offline
                        Martin 0
                        wrote on last edited by
                        #11

                        Please, please, please, stop it. You should respond to the question sender not to an answere. And don't create so many posts, modify your original psot if you have additional ideas. All the best, Martin

                        1 Reply Last reply
                        0
                        • Z zappingz

                          Which version of .net are you trying it on?

                          C Offline
                          C Offline
                          Colin Angus Mackay
                          wrote on last edited by
                          #12

                          If you read the previous part of the thread you'll see he's using MFC C++ and posted in the wrong forum.


                          Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

                          1 Reply Last reply
                          0
                          • Z zappingz

                            Which version of .net are you trying it on?

                            D Offline
                            D Offline
                            Dave Kreskowiak
                            wrote on last edited by
                            #13

                            First off, you're talking to yourself. You're the only one getting notifications that you replied, to yourself. Second, none of what you said is applicable to the OP's problem, because he's using C++/MFC, not C# or the .NET Framework.

                            A guide to posting questions on CodeProject[^]
                            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                                 2006, 2007

                            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