Click here to Skip to main content
15,899,313 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Could not create a ListBox in CView. Pin
Kefir29-Jan-03 7:32
Kefir29-Jan-03 7:32 
GeneralRe: Could not create a ListBox in CView. Pin
SUPER_ZORRO31-Jan-03 0:47
SUPER_ZORRO31-Jan-03 0:47 
General"A Network cable is unplugged" Pin
Bateman29-Jan-03 2:46
Bateman29-Jan-03 2:46 
GeneralResinign the formview with controls in it on system resolution change Pin
sulaxan29-Jan-03 2:36
sulaxan29-Jan-03 2:36 
GeneralDES Encryption Pin
Zaid Ansari29-Jan-03 2:06
Zaid Ansari29-Jan-03 2:06 
GeneralRe: DES Encryption Pin
Chris Losinger29-Jan-03 5:47
professionalChris Losinger29-Jan-03 5:47 
QuestionDo disabled buttons buffer the no of clicks -?? Pin
Ind29-Jan-03 2:04
Ind29-Jan-03 2:04 
AnswerRe: Do disabled buttons buffer the no of clicks -?? Pin
Roger Allen29-Jan-03 3:10
Roger Allen29-Jan-03 3:10 
You have to look at the problme in the point of view of the thread executing the code. In your case its the user interface thread. This means that during the sleep() command you are not processing any message in the message queue. So what happens in the thread is disable,wait, enable, process other messages.

What you need to do is disable the button and wait in a message processing loop for the time required. Then the additional button presses will be ignored.

A typical way to do this would be to do:

MSG msg ;
while (::PeekMessage(&msg, NULL, 0, 0, PM_NOYIELD | PM_REMOVE))
{
    ::TranslateMessage(&msg) ;
    ::DispatchMessage(&msg) ;
}

You will need to setup the correct timing of this to last the time required.


Roger Allen
Sonork 100.10016

WHats brown and sticky?
A stick or some smelly stuff!

GeneralRe: Do disabled buttons buffer the no of clicks -?? Pin
Ind31-Jan-03 3:27
Ind31-Jan-03 3:27 
General[WinInet] Retrieving error info from FTP Pin
Marcelo N. Magri29-Jan-03 1:07
Marcelo N. Magri29-Jan-03 1:07 
GeneralRe: [WinInet] Retrieving error info from FTP Pin
Ben Burnett29-Jan-03 10:46
Ben Burnett29-Jan-03 10:46 
Generalpassing CArray in functions Pin
r i s h a b h s29-Jan-03 0:02
r i s h a b h s29-Jan-03 0:02 
GeneralRe: passing CArray in functions Pin
jhwurmbach29-Jan-03 1:33
jhwurmbach29-Jan-03 1:33 
GeneralRe: passing CArray in functions Pin
HENDRIK R29-Jan-03 2:38
HENDRIK R29-Jan-03 2:38 
GeneralRe: passing CArray in functions Pin
r i s h a b h s29-Jan-03 17:31
r i s h a b h s29-Jan-03 17:31 
GeneralRe: passing CArray in functions Pin
HENDRIK R29-Jan-03 21:40
HENDRIK R29-Jan-03 21:40 
GeneralRe: passing CArray in functions Pin
Alvaro Mendez29-Jan-03 4:07
Alvaro Mendez29-Jan-03 4:07 
GeneralRe: passing CArray in functions Pin
r i s h a b h s29-Jan-03 17:29
r i s h a b h s29-Jan-03 17:29 
Generalmy cancel button is not working Pin
Mr Bose Dayala29-Jan-03 0:02
Mr Bose Dayala29-Jan-03 0:02 
GeneralRe: my cancel button is not working Pin
Debs29-Jan-03 1:48
Debs29-Jan-03 1:48 
GeneralRe: my cancel button is not working Pin
Mr Bose Dayala29-Jan-03 2:13
Mr Bose Dayala29-Jan-03 2:13 
GeneralRe: my cancel button is not working Pin
Debs29-Jan-03 2:36
Debs29-Jan-03 2:36 
GeneralRe: my cancel button is not working Pin
Mr Bose Dayala29-Jan-03 2:40
Mr Bose Dayala29-Jan-03 2:40 
GeneralRe: my cancel button is not working Pin
Debs29-Jan-03 22:56
Debs29-Jan-03 22:56 
GeneralRe: my cancel button is not working Pin
Mr Bose Dayala29-Jan-03 23:05
Mr Bose Dayala29-Jan-03 23:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.