|
|
|
You are welcome
|
|
|
|
|
Take a look at FlashWindow() and FlashWindowEx()
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hello guys,
I am frequently using one WorkerThread in my application. It is starting using AfxBeginThread() function. When I run application from within IDE, debug window is also not showing any memory leake.
But when I run this application in Windows NT, its task manager shows memory usage going on increasing by time in chunk of 4 KB.
Can anybody show me the way to control this memory wastage.
Thanking You,
C.R.Naik
|
|
|
|
|
There are several possible reasons. One reason is that the threads do not terminate correctly. Another reason is that the process does not deallocate memory correctly.
Kuphryn
|
|
|
|
|
1. I have used "return 0;" statement to return from thread's controlling function and hence to terminate thread.
2. How can you make sure that the process deallocates memory correctly ?
Thanking You
C.R.Naik
|
|
|
|
|
Hello All,
I am trying to find a easy-to-understand way where I set up a handler that can detect changes to my windows screen. basically, whenever the screen changes, I want to be notified by Windows.
I know that I can tap in to windows hooks to do this, but I have not been able to understand the code too well.
Is there a simple tutorial that can guide me through this problem. TIA.
RGB
|
|
|
|
|
Hi all,
I am trying to make my ListView (displaying files) scroll without any flickering. But I cannot get it work. I tried for example putting GetListCtrl().SetRedraw(FALSE) and GetListCtrl().SetRedraw(TRUE) around CListView::OnKeyDown() call if key pressed was PAGE DOWN or PAGE UP, but it made things even worse.
For example this program does absolutely no flickers!
http://www.altap.cz/ftp/salamand/salen200.exe
Try scrolling eg. WINNT\System32 directory of any other directory with thousand of files with Page Down key held and you will see that.
How is this possible???
I am using virtual ListView.
Thank you for any suggestion!
|
|
|
|
|
Maybe you should do a search here at CP for articles by "Keith Rule" and see his CMemDC class.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
Thanks for your suggestion Colin. Unfortunately, CMemDC doesn't work for my CListView-derived class. CMyView::OnDraw() is never executed and returning FALSE in OnEraseBackground() casues my ListView not being updated and look ugly...Don't you know why?
Best regards,
Standa.
|
|
|
|
|
s_k wrote:
CMyView::OnDraw() is never executed
That's correct behaviour. View derived from CCtrlView never have their OnDraw() method called. You'll have to use OnPaint() instead.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
But how can I then use CMemDC class, when it needs CDC pointer to be passed to constructor?
|
|
|
|
|
void CMyList::OnPaint()
{
CPaintDC dc(this);
CMemDC memDC(&dc);
}
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thank you Ryan, it works. But, in fact, I don't know what to wirte into OnPaint() handler routine. I have just CListView that displays list of files on local drives and the only thing I wanted to achieve is to get rid of flickering while scrolling the content of ListView....
|
|
|
|
|
void CMyList::OnPaint()
{
CPaintDC dc(this);
CMemDC memDC(&dc);
DefWindowProc(WM_PAINT, (WPARAM)memDC.m_hDC, 0);
} Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks Ryan! Now list of files is drawn, but for example column headers are not visible till I click on them. I'm using Custom Draw feature, maybe it has something to do with it...
|
|
|
|
|
s_k wrote:
I'm using Custom Draw feature, maybe it has something to do with it...
Possibly, but I'd still expect it to work. I haven't done this with custom draw, so I don't really know. Try removing the custom draw, and then trying again. If it paints, then that's good, and you might just have to do without the custom draw. You might need to do full owner draw instead. If not, I'm sorry I can't help much more.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
You have to exclude the headers from the clipbox,
Try something like this...
CPaintDC dc(this);<br />
<br />
CRect headerRect;<br />
CRect clientRect;<br />
<br />
GetClientRect(&clientRect);<br />
GetDlgItem(0)->GetWindowRect(&headerRect);<br />
ScreenToClient(&headerRect);<br />
dc.ExcludeClipRect(&headerRect);<br />
<br />
CMemDC memDC(&dc);<br />
<br />
DefWindowProc(WM_PAINT, (WPARAM)memDC->m_hDC, (LPARAM)0);<br />
<br />
Arjan
|
|
|
|
|
Does CListCtrl::Scroll() not work?
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi,
maybe I post my question in a wrong way - I AM able to scroll the content of my ListView, I have vertical scrollbar there and pressing Key Down/Up keys also scroll the ListView. But in case when I have for example 10.000 files in ListView and I'm holding Page Key/Up or moving fastly with scroll bar, ListView "flashes", or how to say that...So I'm looking for some method with help of which I would make my ListView scroll without flashing/flickering...And in post there is link to one piece of software that does it greatly.
Best regards,
Standa.
|
|
|
|
|
Ok, I misunderstood your question.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
how can i put a flash interfacein my MFC Program????
|
|
|
|
|
10 Simple steps
1. Make a movie in flash that is one frame long, and all the other movie clips are in this one movie.
2. Add your buttons and controls in flash.
3. Using actionscript add a global variable for when each control is selected or moused over etc (Roll Over)
4. Add the ocx and header stuff to your MFC app
5. Include the swf file in your workspace
6. Use the res protocol to load the swf movie when needed
7. Start a timer.
8. When the timer fires have it poll the flash variable to see it's state.
9. Do the button actions intentions.
10. If all this works out Ok, to show your appreciation you can write a CP Article about how it's done.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
HMMDemo compiles but I get this error
In function cvGetMat():[......cvarray.cpp Line 2734]....
NULL pointer passed....
ErrMode=CV_ErrorModeLeaf
What should I do to correct this error?
(MSVC++ 6.0 sp5, windows xp home)
Later, JoeSox www.humanaiproject.org
"The worst fad has been these stupid little robots,
Graduate students are wasting 3 years of their lives
soldering and repairing robots, instead of making them smart.
It's really shocking." -Marvin Minsky.
|
|
|
|