|
Peter Weyzen wrote: this CWinThread thing needs to go. But I can't do that now.
bummer. The fact that this is happening shows a design problem IMO.
Idle means no messages yet I presume you're using window messages for socket
notifications - not necessarily a good combo
What is WM_IDLE?
Take a look at CWinThread::Run(). Idle processing is pretty simple from there (the
complexity is in the handling of OnIdle())...
maybe you can override it to pump out more OnIdle() calls - perhaps on every socket message.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It's code that I am stuck with -- and a release is coming soon -- so all I can do is find ways to make it behave better....
I'd like to just force it to do some idle processing...
The smartest thing will probably to move stuff out of that dumb idle handler... but I'd rather that quick "make it behave better" immediate fix.
Thanks for your comments. I come to codeproject to ask these esoteric questions, and most often there's little response to them.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
I have only ever done this with the main thread by simply calling CWinThread::OnIdle(-1). Passing -1 causes the idle handler function to run at least once. I have done this to force toolbars to update.
|
|
|
|
|
Has anyone got macros working for VS2005 under Vista? They are completely broken, and the fix for VS2005 on xp does not work... this is retarded
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=225977
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2022094&SiteID=1
|
|
|
|
|
|
Yeah I have vs2005 SP1 for vista installed and it is still a dud... This is very frustrating because I wrote a lot of macros to make vs2005 more keyboard friendly --- as it's lack of keyboard friendliness it quite terrible.
O mouse o mouse o mouse.
|
|
|
|
|
I'm wondering how to build a Drop-down dialog. In other words, when user clicks a button, instead of popping up a separate dialog, it would show an in-place drop-down dialog from the button. It's kind like a drop-down menu, but instead of just having menu items it is a dialog/form that you can add different controls to it.
Below is a sample screenshot that I captured from RoboForm that is doing this. Actually this one is even cooler - I didn't have to click on the button, the drop-down dialog showed when I hover over the toolbar button.
http://img219.imageshack.us/img219/1158/dropdowndialogjq5.jpg[^]
Does anybody have idea how to do this?
|
|
|
|
|
It's a modeless dialog that stays on top of the application.
Either on the button click or hover show the dialog; the dialog is dismissed when the user clicks anywhere outside the dialog itself.
|
|
|
|
|
Hi Every Body,
I have a problem which relatively easily. but struggling with that a lot.
How do i set the Home Page for IE programmatically without actually putting my hands on registry, Any APIs or class ?? can anybody help me please.
Thank s a lot in advance
bye
P.Somasundaram
|
|
|
|
|
somasundarambe wrote: How do i set the Home Page for IE programmatically without actually putting my hands on registry, Any APIs or class ??
You can't.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Isn't that like how can I do something programmatically without programming?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Isn't that like how can I do something programmatically without programming?
I know you are bent on doing this, Mark, but it just isn't possible. Now play nice or you'll be sitting in time-out.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i create a MFC(Dialog Based) project and insert the WMP ActiveX control in it , now i want to change the skin of WMP AciveX control , but i don't know how to do that , can anybody help me ? (the sample in the SDK using ATL/COM)
|
|
|
|
|
Is it possible? It seems to be automatic based on background color.
|
|
|
|
|
|
This article is about CList not CListCtrl and has nothing about changing the grid color.
|
|
|
|
|
see subject!
guojing
|
|
|
|
|
guojing1982423 wrote: see subject!
I did, but your question makes little sense. Please rephrase.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
i have download an octree algorithm used to reduce the number of colors, but after got the new color palette by the octree alorithm, how can i transfer the 24bits R,G,B value into 8bits palette index?
for example, the 24bits pixel value is : R=125,G=100,B=231, how to change the three value into one value of palette index?
thanks!
|
|
|
|
|
The general answer is there are 2 parts to this sort of thing
1) Turn your 24 bit value into an 8 bit value
2) Look up the nearest colour in the pallette to the generated 8 bit value and use that index.
Part 1 is just math and your choice as to how you scale, bit shift and || together the values to form an 8 bit number.
Part 2 is harder in principle because you need to index your pallette. With only an 8-bit pallette though a straight nearest match linear search is probably fine.
I'm sure you can write reasonably efficient code to do these two steps.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
You should be able to
1) Use the octree algorithm to create an optimal palette based on the image pixel values
2) Use the resulting palette and the GetNearestPaletteIndex() API to convert each image
pixel to an index into the palette.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thanks.
i have done the first step that creat an optimal palette, i will try the GetNearestPaletteIndex() API . further more i want to know the algorithm of converting rgb pixel to palette index based on the optimal palette. would you give me more help? thanks again.
|
|
|
|
|
Lao Wang wrote: i want to know the algorithm of converting rgb pixel to palette index based on the optimal palette
The GetNearestPaletteIndex() API does that but I'm not sure what algorithm it uses.
I don't have algorithms to share but a quick Google search gives some ideas like:
3-D Lookup Table Color Matching[^]
quick Color Averaging[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|