|
At the top of the "Solution Pane" there is a icon button "Show All Files" that toggles between two modes, one of them only shows relevant files in the pane. Maybe that can solve your problem.
|
|
|
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|
Well, its a nod to the colonials!
==============================
Nothing to say.
|
|
|
|
|
That would only work if you rebuilt the entire Windows debug library.
|
|
|
|
|
|
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.
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
|
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 in CMainDlg 's constructor like this
CMainDlg::CMainDlg(CWnd* pParent ): 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");
}
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.
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
|
Hi,
I am running derived CAsynSocket class inside a CWinThread Class
I am looking to see if a connection status is still up
would running ping utility durning thr CWinThread::OnIdle do the trick
Thanks
|
|
|
|
|
Do not run the ping utility.
ping.exe is an external file that can be deleted and then your objective will fail.
Instead, send a special packet or use a separate socket to send a packet in the OnIdle function or in a timer event.
|
|
|
|
|
|
No, do not use Ping and do not rely on running it in OnIdle(), you should use a timer.
There are several ways a TCP link can "break" without both sides being properly notified, especially over the Internet, but even on a LAN. If it is important to you to have reliable, persistent links and you have control over the server side code, I suggest you define a keep-alive mechanism.
There are many, many ways of doing this. Over the years I have found the following approach to be sufficient just about anywhere I use persistent TCP connections.
- Determine which side will be sending data the most. Let's call that side A, the other side is side B. Depending on the nature of your applications, side A can be either the server or the client.
- Determine the maximum time a link can be down before reacting to it - 1 second, 10 seconds, 30 seconds, etc. Let's call that T. You do not want to flood the network with these messages, so go as high as you can.
While connected:
- Side A must keep track of the last time a message (data or keep-alive) was sent. If more than T/3 seconds have passed since a message was sent, send a keep-alive message. If the link has gone down, the socket send operation will fail and the program has to react to it.
- Side B must keep track of the last time a message (data or keep-alive) was received. If more than T seconds have passed since a message was received, consider the link down and react to it.
Soren Madsen
|
|
|
|
|
|
what is operator overloading and how it works with code.
|
|
|
|
|
|
it refers to providing additional meaning to normal c++ operators when they are applied to user defined data types
|
|
|
|
|
I want into MDI application to open an menu item on OnLButtonDblClk on client zone in CMainFrame ... so I mapped CMainFrame::OnLButtonDblClk :
void CMainFrame::OnLButtonDblClk(UINT nFlags, CPoint point)
{
TRACE("OnLButtonDblClk\n");
CMDIFrameWnd::OnLButtonDblClk(nFlags, point);
}
but I had an suprise ! I didn't see any TRACE on my doubleclick ... why ?
modified 21-Feb-13 4:54am.
|
|
|
|
|
It's a long time since I did any MFC but do you need to add something to your message map?
|
|
|
|
|
The wizzard did that :
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
ON_WM_LBUTTONDBLCLK()
END_MESSAGE_MAP()
|
|
|
|