|
Naveen is correct in that you are not pumping any messages, so with no message flow, your button has no way to indicate that it has been clicked.
A BG thread is the modern way to do it, but you have to be a bit careful if mixing MFC objects and threads. The Old School way to do it is to pump messages inside of your for(...) loop. It may be considered kludgy, but if you ensure that the user cannot activate any other functionality that might break what you are working on, that would be one way to do it.
For example, something along the lines of the following (may need work):
for (int f=0; f< mylist.GetItemCount(); f++)
{
MSG msgMSG;
if( ::PeekMessage( &msgMSG, hWndOfModelessDlg, 0, 0, PM_REMOVE ) )
{
::TranslateMessage( &msgMSG );
::DispatchMessage( &msgMSG );
}
} Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hola James,
I don't think it's kludgy if one understands message loops. Message loops are our responsibility.
It's been that way from the start. MFC hides it from us so it seems alot of us forget we're in
charge of message processing.
For MFC, sometimes CWinThread::PumpMessage is more appropriate
than ::TranslateMessage/::DispatchMessage. Then the pretranslatemessage processing and any
other CWinThread/CWnd shenanigans gets done . Of course, that may not be the desired effect and
at times it's appropriate to bypass the CWinThread message loop processing and eat all the
messages (I do that when "rubberbanding").
for (int f=0; f< mylist.GetItemCount(); f++)
{
MSG msg;
while (::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE))
{
if (!AfxGetApp()->PumpMessage())
{
break;
}
}
}
Piece,
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
i m aarti want a question 4 only c
|
|
|
|
|
aarti sharma wrote: hello
hello
aarti sharma wrote: i m aarti
nice to meet you, hard to understand you
aarti sharma wrote: want a question 4 only c
this is the place to ask...
but please please, speak english properly (write full words and explain yourself corretly)
|
|
|
|
|
I guess that questions 1-3 and 4a and 4b have already been asked on this forum, he just wants the answer to 4c.
What's the assignment?
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Hi. 24 M India, Single. Atheletic Physic, Outgoing, down to earth attitude, short tempered, one on one preferred.
What the hell is your question?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
brahmma wrote: Hi. 24 M India, Single. Atheletic Physic, Outgoing, down to earth attitude, short tempered, one on one preferred.
ha ha
Why dont you ask for the orkut profile?
nave
|
|
|
|
|
42!
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
aarti sharma wrote: i m aarti want a question 4 only c
Translation:
I am aarti. I want a question only for seeing.
Ok please see this:
"What are you????"
Enjoy!
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
|
VuNic wrote: Ok please see this:
"What are you????"
who
Enjoy!
might be she want to say .. i am looking for some one name vunic!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hi Aarti
This is a forum for developers/learners in Visual C++.
If you have any question related to C you can also ask.
You can also go to C++ forum in CodeProject.
Cheers!
Ranjoy
|
|
|
|
|
Ranjoy Guha wrote: You can also go to C++ forum in CodeProject
there is no other C++ forum than the one you are in here
for your information, the C++/CLI forum is not for C++, but for Managed C++, that is, the C++ extension for the .NET framework
|
|
|
|
|
OOPs! I forget
Thanks for the info.
Can she place her C question there anyway?
|
|
|
|
|
Ranjoy Guha wrote: Can she place her C question there anyway?
She ? how do you know it's a "she" ? do you know her ?
anyway, of course she can !
as i told in my forst reply, it's the place to go...
|
|
|
|
|
Great........
I think now it is clear to her.........or him....... or whatever......
Cheers!
|
|
|
|
|
|
aarti sharma wrote: m aarti want a question 4 only c
ok what type of question??
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Any question. But she has a condition. It MUST end with a "?" mark !!
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
VuNic wrote:
Any question. But she has a condition. It MUST end with a "?" mark !!
he he he... ask her ?>
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
ask ask
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
VuNic wrote: ask ask
no flirting on programming board
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Ok.. But she looks really beautiful
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
VuNic wrote: Ok.. But she looks really beautiful
ho do you know that?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Can't you look at her profile??
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|