Click here to Skip to main content
16,008,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: GetPrivateProfileInt( ) crashes for a specific domain user on a Specific Machine (Dell Optiplex 755 with Vista Sp1) Pin
Sarath C18-Dec-08 20:13
Sarath C18-Dec-08 20:13 
AnswerRe: GetPrivateProfileInt( ) crashes for a specific domain user on a Specific Machine (Dell Optiplex 755 with Vista Sp1) Pin
Randor 19-Dec-08 3:56
professional Randor 19-Dec-08 3:56 
QuestionGet icon/bitmap from CMenu on Owner Draw Menu ?? Pin
karhong18-Dec-08 19:12
karhong18-Dec-08 19:12 
AnswerRe: Get icon/bitmap from CMenu on Owner Draw Menu ?? Pin
Sarath C18-Dec-08 20:21
Sarath C18-Dec-08 20:21 
Questionneed difference between using static variable in 'C' and 'C++' ? Pin
Sakthiu18-Dec-08 18:16
Sakthiu18-Dec-08 18:16 
AnswerRe: need difference between using static variable in 'C' and 'C++' ? Pin
Sarath C18-Dec-08 20:25
Sarath C18-Dec-08 20:25 
QuestionProblem using Queue timers.............. Pin
shaina223118-Dec-08 17:47
shaina223118-Dec-08 17:47 
AnswerRe: Problem using Queue timers.............. Pin
Stuart Dootson18-Dec-08 23:04
professionalStuart Dootson18-Dec-08 23:04 
shaina2231 wrote:
i m creating 3 queutimers and after adding them in queue using 3 callbacks functions for each timer ,and calling one function after 10ms 2nd func after 100 ms,3rd func after 1sec


No you're not, you've set the parameters incorrectly. The 10, 100 and 1000 arguments are specified in the DueTime position. You've specified 1ms for the period. Also, the last parameter of CreateTimerQueueTimer is a flag argument. Looking at this page[^], the valid values for that parameter do not include 4...which is what you've used for one of the timers.

Your CreateTimerQueueTimer calls should look more like this:
CreateTimerQueueTimer( &t, htimer,TimerRoutine, &arg , 1000, 10, WT_EXECUTEINIOTHREAD);
CreateTimerQueueTimer( &t2, htimer,TimerRoutine2, NULL, 1000, 100, WT_EXECUTEINIOTHREAD);
CreateTimerQueueTimer( &t3, htimer,TimerRoutine3,NULL , 1000, 1000, WT_EXECUTEINIOTHREAD);


WT_EXECUTEINIOTHREAD is defined in winnt.h as 0x00000001. If you're using VC6, do yourself a favour and install a modern Platform SDK. Then you won't need to do stuff like call LoadLibrary and GetProcAddress to get the CreateTimerQueue function's address - you can use the kernel32 import library - and you can use symbolic constants like WT_EXECUTEINIOTHREAD rather than numbers that you can get wrong (and you did get one wrong).

Also - the timer callbacks are likely to be called on different threads than the UI thread. That means that you possibly shouldn't be calling SetWindowText, as (I think) it sends a Windows message rather than posting it.
QuestionContext help systems in VC8 with MFC Pin
snavece18-Dec-08 10:08
snavece18-Dec-08 10:08 
AnswerRe: Context help systems in VC8 with MFC Pin
Stuart Dootson18-Dec-08 10:46
professionalStuart Dootson18-Dec-08 10:46 
GeneralRe: Context help systems in VC8 with MFC Pin
snavece19-Dec-08 8:03
snavece19-Dec-08 8:03 
QuestionHow to program UI so it works with all font sizes and dpi's ? Pin
Defenestration18-Dec-08 7:20
Defenestration18-Dec-08 7:20 
AnswerRe: How to program UI so it works with all font sizes and dpi's ? Pin
Randor 18-Dec-08 7:30
professional Randor 18-Dec-08 7:30 
GeneralRe: How to program UI so it works with all font sizes and dpi's ? Pin
Defenestration18-Dec-08 10:37
Defenestration18-Dec-08 10:37 
QuestionMFC Internals EBook Pin
riteshsv18-Dec-08 6:40
riteshsv18-Dec-08 6:40 
QuestionRe: MFC Internals EBook Pin
David Crow18-Dec-08 6:43
David Crow18-Dec-08 6:43 
AnswerRe: MFC Internals EBook Pin
sunilkumar_prog30-Sep-10 2:14
sunilkumar_prog30-Sep-10 2:14 
AnswerRe: MFC Internals EBook Pin
Eytukan18-Dec-08 6:58
Eytukan18-Dec-08 6:58 
AnswerRe: MFC Internals EBook Pin
CPallini18-Dec-08 10:47
mveCPallini18-Dec-08 10:47 
Questionconfigure local area connection properties programatically Pin
skydiver13518-Dec-08 5:54
skydiver13518-Dec-08 5:54 
AnswerRe: configure local area connection properties programatically Pin
led mike18-Dec-08 6:55
led mike18-Dec-08 6:55 
AnswerRe: configure local area connection properties programatically Pin
Randor 18-Dec-08 6:58
professional Randor 18-Dec-08 6:58 
AnswerRe: configure local area connection properties programatically Pin
Stuart Dootson18-Dec-08 10:42
professionalStuart Dootson18-Dec-08 10:42 
QuestionMFC CSocket and thread: architecture and performance Pin
popacio18-Dec-08 5:43
popacio18-Dec-08 5:43 
AnswerRe: MFC CSocket and thread: architecture and performance Pin
Mark Salsbery18-Dec-08 6:02
Mark Salsbery18-Dec-08 6:02 

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.