|
Considering that the OP wrote:
Dependent on circumstances, MyTimerProc() may need to ask for user intervention [...] - It sounds like the timer function is doing something other than showing a message box. Because of that, stopping the time may not be such a good idea...
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
|
|
|
|
|
Then, just stop the timer when the messagebox has to be shown. The timer proc (I assume) will have to wait for a response anyway.
Else, another way could be to let the timer proc start a thread that shows the messagebox. That way, the thread can keep on working, and the thread is responsible for getting input from the message box.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Killing, then re-enabling the timer looks to be the way forward. A little annoyed I didn't think of it myself!
Thanks for the input everyone!
|
|
|
|
|
I'm glad to be able to help you out.
And sometimes, the simplest answers are the hardest to find.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Show a Dialog instead of message box and kill the timer.
Then notify the parent class to start the timer, when the dialog is about to destroy.
Do your Duty and Don't expect the Result
|
|
|
|
|
Not sure why your post had a score of 3, you gave the same advice that I'd give. Kill the timer in MyTimerProc() and then re-set it after the UI is dismissed.
|
|
|
|
|
Michael Dunn wrote: Not sure why your post had a score
Michael Dunn wrote: you gave the same advice that I'd give
Sorry, is it You or Kakan? Only 2 Min difference, seems i didn't refresh my page before i hit the reply link...
Do your Duty and Don't expect the Result
Rate this Post, if I helped You
|
|
|
|
|
There's nothing wrong with your code. Using a critical section is pointless since you've only got one thread. Same goes for the other synchronisation primitives.
Steve
|
|
|
|
|
Hello Comunity,
is there any function to determine is it a folder or file, e.g.
C:\folder\file.txt <-- path to file
C:\folder\files\ <-- path to folder
C:\folder\files <-- path to folder
thanks in advance
regards
break
|
|
|
|
|
|
Hello Prasad,
thanks for answer!
regards
break;
-- modified at 7:30 Thursday 22nd March, 2007
|
|
|
|
|
break; wrote: thanks for quick answer!
So why do you delay in polling a quick vote for him?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
When all of the dust settles, does it even matter when, or even if, he votes?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Not really that it matters, but IMO they should be thankful when they get help, but they don't do..
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Last time I checked, "thanks for answer" was being thankful. That in itself is all that's necessary to express thanks. Voting is nothing but extra.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Here's a Win95 compatible way of doing it:
DWORD dwAttrib = GetFileAttributes(psPath);
if(0xFFFFFFFF == dwAttrib)
dwAttrib = 0;
if(0 != (dwAttrib&FILE_ATTRIBUTE_DIRECTORY))
|
|
|
|
|
Hello,
thank you for help
regards
termal
|
|
|
|
|
Hi all,
I am writing one win32 Application using VC++.NET 2003. I am getting one wired error in my thread proc. I am creating one thread using CreateThread() function.
this->m_threadHwnd = CreateThread(NULL, 0, ThreadFunc, this, 0, NULL);
But when I am using Sleep() function in this ThreadFunc() it gives me error like “There is no source code available for the current location” . Sleep() function is working fine with other methods but not with ThreadFunc(). Can I know hoe can I solve this problem?
Thanks in advance,
Priyank
|
|
|
|
|
priyank_ldce wrote: “There is no source code available for the current location”.
Possibly, you are trying to step in to Sleep API while debugging, isn't it ?
|
|
|
|
|
Perhaps a little bit off topic, but it may solve your problem anyway...
The call to ::Sleep() should probably be removed.
When mentioning a sleep operation together with multithreading, chances are that the multithreading concept is not quite understood. Even the use of ::Sleep() is a warning sign itself.
Read about why ::Sleep() should be avoided here[^].
Read about how multithreading should be done here[^].
I humbly advise you to read the articles since they will prevent you from doing common mistakes that you will have a hard time tracking down later.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Excellent source material – I’ll try to remember it.
(You are forgive! for the VB phase)
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
John R. Shaw wrote: Excellent source material
Yep, Joe's entire site is quite a gold mine in my opinion.
John R. Shaw wrote: You are forgive! for the VB phase
Thanks John, it took me a little while to understand what you meant though.
I didn't expect anyone to actually read the bio.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: Yep, Joe's entire site is quite a gold mine in my opinion.
My best source of that kind of information is CP; meaning you and others on the boards.
Roger Stoltz wrote: Thanks John, it took me a little while to understand what you meant though.
I didn't expect anyone to actually read the bio.
VB was ok and VB.Net is much better, and we can use that. They are programmers, but it is what they do not know that bothers me.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hai,
Greetings of the day!. My doubt is how to update the data's present in the Listcontrol. I am having a List control in VC++ dialog based application, populated with some datas. As soon as i get a new data, the old data has to be updated with new one. Is there any way to solve to my problem. Please help with giving a sample program.
Regards
Jagan
|
|
|
|
|
Look at CListCtrl::Update and CListCtrl::RedrawItems
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|