Switch off Debug Assertions
-
Hi, I have a problem, i got a huge project which works nice in release build, but in debug version I get thousands of debug assertion failures, which i realy dont want to care about. It is this kind of thing what is failing (in afxwin2.inl): (m_hWnd is NULL)
_AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow)
{ ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); }With these debug assertions it is not possible for me to Debug the project. I just want to change a little part of the project, but without debugmode (i need traces and so on) this will become very hard, so it is in any way possible to switch them off ? And yes, i know assertions are my best friend, because they tell me something is wrong, but in this case I do not want to care about what is wrong, I only want to get my work done quickly without reprogramming the application. Thank you ;)
-
Hi, I have a problem, i got a huge project which works nice in release build, but in debug version I get thousands of debug assertion failures, which i realy dont want to care about. It is this kind of thing what is failing (in afxwin2.inl): (m_hWnd is NULL)
_AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow)
{ ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); }With these debug assertions it is not possible for me to Debug the project. I just want to change a little part of the project, but without debugmode (i need traces and so on) this will become very hard, so it is in any way possible to switch them off ? And yes, i know assertions are my best friend, because they tell me something is wrong, but in this case I do not want to care about what is wrong, I only want to get my work done quickly without reprogramming the application. Thank you ;)
You could try redefining the ASSERT macro into something that doesn't do anything.
The difficult we do right away... ...the impossible takes slightly longer.
-
Hi, I have a problem, i got a huge project which works nice in release build, but in debug version I get thousands of debug assertion failures, which i realy dont want to care about. It is this kind of thing what is failing (in afxwin2.inl): (m_hWnd is NULL)
_AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow)
{ ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); }With these debug assertions it is not possible for me to Debug the project. I just want to change a little part of the project, but without debugmode (i need traces and so on) this will become very hard, so it is in any way possible to switch them off ? And yes, i know assertions are my best friend, because they tell me something is wrong, but in this case I do not want to care about what is wrong, I only want to get my work done quickly without reprogramming the application. Thank you ;)
-
Hi, I have a problem, i got a huge project which works nice in release build, but in debug version I get thousands of debug assertion failures, which i realy dont want to care about. It is this kind of thing what is failing (in afxwin2.inl): (m_hWnd is NULL)
_AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow)
{ ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); }With these debug assertions it is not possible for me to Debug the project. I just want to change a little part of the project, but without debugmode (i need traces and so on) this will become very hard, so it is in any way possible to switch them off ? And yes, i know assertions are my best friend, because they tell me something is wrong, but in this case I do not want to care about what is wrong, I only want to get my work done quickly without reprogramming the application. Thank you ;)
mackel90 wrote:
i got a huge project which works nice in release build
You realize that the assertion is telling you that you are issuing Scroll Bar Functions to an object that is not realized as a window. That is, the fact that m_HWND is NULL means that you are trying to scroll a window that doesn't exist. I'm not sure of your definition of "working fine" but this ain't my definiton. You should fix these.
-
Hi, I have a problem, i got a huge project which works nice in release build, but in debug version I get thousands of debug assertion failures, which i realy dont want to care about. It is this kind of thing what is failing (in afxwin2.inl): (m_hWnd is NULL)
_AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow)
{ ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); }With these debug assertions it is not possible for me to Debug the project. I just want to change a little part of the project, but without debugmode (i need traces and so on) this will become very hard, so it is in any way possible to switch them off ? And yes, i know assertions are my best friend, because they tell me something is wrong, but in this case I do not want to care about what is wrong, I only want to get my work done quickly without reprogramming the application. Thank you ;)
You should never, never ignore such assertions. If such assertions fail, it mean that your code is wrong and shouild be fixed. By the way, if you somehow disable assertion there, then what would happen with assertion in your own code. Assertion is a tool to help make good and correct code. Learn to use them correctly.
Philippe Mori
-
Hi, I have a problem, i got a huge project which works nice in release build, but in debug version I get thousands of debug assertion failures, which i realy dont want to care about. It is this kind of thing what is failing (in afxwin2.inl): (m_hWnd is NULL)
_AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow)
{ ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); }With these debug assertions it is not possible for me to Debug the project. I just want to change a little part of the project, but without debugmode (i need traces and so on) this will become very hard, so it is in any way possible to switch them off ? And yes, i know assertions are my best friend, because they tell me something is wrong, but in this case I do not want to care about what is wrong, I only want to get my work done quickly without reprogramming the application. Thank you ;)
This post shouldnt be voted down because it is important that beginner programmers understand why DEBUG ASSERTS must be resolved. mackel90, you really need to learn to program properly. And so do your colleagues who put this project together. Read the other good comments here, and think very very carefully about what is being said. YOU MUST RESOLVE THESES DEBUG ASSERTS BEFORE YOU BUILD A RELEASE VERSION. It is also good practice to back up a DEBUG ASSERT with a line of code that checks the same thing and exits the func so in release mode you have the same level of protection.
============================== Nothing to say.
-
You could try redefining the ASSERT macro into something that doesn't do anything.
The difficult we do right away... ...the impossible takes slightly longer.
-
You could try redefining the ASSERT macro into something that doesn't do anything.
The difficult we do right away... ...the impossible takes slightly longer.
That would only work if you rebuilt the entire Windows debug library.
-
Hi, I have a problem, i got a huge project which works nice in release build, but in debug version I get thousands of debug assertion failures, which i realy dont want to care about. It is this kind of thing what is failing (in afxwin2.inl): (m_hWnd is NULL)
_AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow)
{ ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); }With these debug assertions it is not possible for me to Debug the project. I just want to change a little part of the project, but without debugmode (i need traces and so on) this will become very hard, so it is in any way possible to switch them off ? And yes, i know assertions are my best friend, because they tell me something is wrong, but in this case I do not want to care about what is wrong, I only want to get my work done quickly without reprogramming the application. Thank you ;)
Take my opinion as a pointer, not a definite answer. Most likely you are doing something with one of your controls when it is not loaded/initialized yet. For example, say you have a dialogbox named
CMainDlg
. Now If you try to set text of an editbox inCMainDlg
's constructor like thisCMainDlg::CMainDlg(CWnd* pParent /*=NULL*/): CDialogEx(CAccountDlg::IDD, pParent)
{
GetDlgItem(IDC_TEXT1)->SetWindowText("Debug Assertion");
}then a debug assertion will be shown. A better way will be do this in
OnInitDialog
like this (or in an event handler, bound with a button)BOOL CMainDlg::OnInitDialog()
{
GetDlgItem(IDC_TEXT1)->SetWindowText(" No Debug Assertion");// some other stuff
}So out and out, you are doing a right thing in a wrong way. Hope you understand what I mean :)
This world is going to explode due to international politics, SOON.
-
You sir, are a dangerous idiot. Seriously, no one listen to this, it is dangerous stupid advise.
============================== Nothing to say.
Erudite_Eric wrote:
it is dangerous stupid advise.
You sir, are an illiterate idiot.
The difficult we do right away... ...the impossible takes slightly longer.
-
Hi, I have a problem, i got a huge project which works nice in release build, but in debug version I get thousands of debug assertion failures, which i realy dont want to care about. It is this kind of thing what is failing (in afxwin2.inl): (m_hWnd is NULL)
_AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow)
{ ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); }With these debug assertions it is not possible for me to Debug the project. I just want to change a little part of the project, but without debugmode (i need traces and so on) this will become very hard, so it is in any way possible to switch them off ? And yes, i know assertions are my best friend, because they tell me something is wrong, but in this case I do not want to care about what is wrong, I only want to get my work done quickly without reprogramming the application. Thank you ;)
mackel90 wrote:
...i got a huge project which works nice in release build...
No, you just think it is working nicely. The problems just haven't shown themselves visibly yet.
mackel90 wrote:
...I do not want to care about what is wrong, I only want to get my work done quickly...
Please do not work on any projects used by folks other than yourself.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
Hi, I have a problem, i got a huge project which works nice in release build, but in debug version I get thousands of debug assertion failures, which i realy dont want to care about. It is this kind of thing what is failing (in afxwin2.inl): (m_hWnd is NULL)
_AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow)
{ ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); }With these debug assertions it is not possible for me to Debug the project. I just want to change a little part of the project, but without debugmode (i need traces and so on) this will become very hard, so it is in any way possible to switch them off ? And yes, i know assertions are my best friend, because they tell me something is wrong, but in this case I do not want to care about what is wrong, I only want to get my work done quickly without reprogramming the application. Thank you ;)
mackel90 wrote:
I only want to get my work done quickly
The foresight of that thought sure seems to be an oxy-moron in hindsight I want to get my work done quickly today, so I can triple my work tomorrow. I still don't understand how the current release version can work perfectly, unless he broke the project and can't fix it, or the current release version was never fully tested, and it really doesn't work perfectly. Perhaps the OP is having a really bad day, and is ready to go postal.
-
Erudite_Eric wrote:
it is dangerous stupid advise.
You sir, are an illiterate idiot.
The difficult we do right away... ...the impossible takes slightly longer.