|
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.
|
|
|
|
|
Hi all!
I'm trying to execute:
_asm
{
hlt
}
and of course I am getting an error (since hlt is a privileged ASM instruction). I'd like to know how to get this working (I know software like CPUIdlePro does that, so there MUST be a way
Thanks in advance.
|
|
|
|
|
I believe Win2k and XP are already doing this. And the answer to your question is you have to write a device driver.
John
|
|
|
|
|
Hi all,
I am wondering how to read an XML feed from a website programatically?
If I am using a browser I just type in the corresponding info into the address bar and the results are returned as an XML file displayed in the browser.
How programatically can you query a website for its XML feed without opening the browser?
Thanks,
Steve
|
|
|
|
|
How about using WinInet
and stuff like CInternetSession, CHttpFile, CHttpConnection, depending on what you want todo their are several ways of doing this.
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
|
|
|
|
|
|
It's simple if you're using the MS XML parser:
#import <msxml.dll>
MSXML::IXMLDOMDocumentPtr pDoc;
pDoc.CreateInstance ( __uuidof(MSXML::DOMDocument), NULL,
CLSCTX_INPROC_SERVER );
pDoc->async = VARIANT_FALSE;
pDoc->load ( "http://www.foo.com/path/to/file.xml" ); You'd need to add error handling, of course
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Thanks all very useful info.
Steve
|
|
|
|
|
Hi
Is there any method to view EXE flash macromedia file in a window in my application ? (like avi files)
Thanks very much
|
|
|
|