Click here to Skip to main content
15,879,239 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Is there any mistake for right click menu for List Ctrl. Pin
Naveen1-Nov-09 17:30
Naveen1-Nov-09 17:30 
QuestionHow can I implement a schedule reboot prompts using WUAPI? Or some other way? Pin
hanq_389101301-Nov-09 17:06
hanq_389101301-Nov-09 17:06 
AnswerRe: How can I implement a schedule reboot prompts using WUAPI? Or some other way? Pin
Naveen1-Nov-09 17:44
Naveen1-Nov-09 17:44 
GeneralRe: How can I implement a schedule reboot prompts using WUAPI? Or some other way? Pin
hanq_389101301-Nov-09 18:01
hanq_389101301-Nov-09 18:01 
Questionwhy CCriticalSection::Lock doesn't allow to set the timeout Pin
Ramon F. Mendes1-Nov-09 14:52
Ramon F. Mendes1-Nov-09 14:52 
AnswerRe: why CCriticalSection::Lock doesn't allow to set the timeout Pin
«_Superman_»1-Nov-09 16:02
professional«_Superman_»1-Nov-09 16:02 
AnswerRe: why CCriticalSection::Lock doesn't allow to set the timeout Pin
Naveen1-Nov-09 17:48
Naveen1-Nov-09 17:48 
AnswerRe: why CCriticalSection::Lock doesn't allow to set the timeout Pin
cmk1-Nov-09 18:31
cmk1-Nov-09 18:31 
A critical section is a higher level construct than a mutex. The current critical section wraps a semeaphore it uses for locking when it has to wait. Before it waits it will spin in user mode to avoid the costly transition to kernel mode and thread context switch.

You have two options to use a timeout with a critical section:

1. (Not recommended) Write a function that uses the internal LockSemaphore. You have to duplicate the functionality for EnterCriticalSection() but allow a timeout to be passed to the wait on the semaphore.

2. Spin on TryEnterCriticalSection. Use GetTickCount to check when you time out. Make sure you do this right. Read up on YieldProcessor, SwitchToThread and Sleep/SleepEx. This is only usefull if you _have to_ use a ctirical section and you _have to_ be able to timeout.

...cmk

The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack

QuestionFailure opening/reading a large file Pin
jocasa1-Nov-09 12:36
jocasa1-Nov-09 12:36 
AnswerRe: Failure opening/reading a large file Pin
CPallini1-Nov-09 20:54
mveCPallini1-Nov-09 20:54 
QuestionRe: Failure opening/reading a large file [modified] Pin
Adam Roderick J1-Nov-09 20:54
Adam Roderick J1-Nov-09 20:54 
AnswerRe: Failure opening/reading a large file Pin
jocasa1-Nov-09 22:23
jocasa1-Nov-09 22:23 
AnswerRe: Failure opening/reading a large file [solved] Pin
jocasa2-Nov-09 2:37
jocasa2-Nov-09 2:37 
QuestionWhy wifstream can not read in numbers? [modified] Pin
transoft1-Nov-09 10:31
transoft1-Nov-09 10:31 
QuestionRe: Why wifstream can not read in numbers? Pin
«_Superman_»1-Nov-09 12:18
professional«_Superman_»1-Nov-09 12:18 
AnswerRe: Why wifstream can not read in numbers? Pin
transoft2-Nov-09 1:35
transoft2-Nov-09 1:35 
GeneralRe: Why wifstream can not read in numbers? Pin
«_Superman_»2-Nov-09 4:06
professional«_Superman_»2-Nov-09 4:06 
GeneralRe: Why wifstream can not read in numbers? [modified] Pin
transoft2-Nov-09 5:24
transoft2-Nov-09 5:24 
QuestionExit Message Box Pin
MrMcIntyre1-Nov-09 8:56
MrMcIntyre1-Nov-09 8:56 
AnswerRe: Exit Message Box Pin
«_Superman_»1-Nov-09 9:24
professional«_Superman_»1-Nov-09 9:24 
GeneralRe: Exit Message Box [modified] Pin
MrMcIntyre1-Nov-09 9:33
MrMcIntyre1-Nov-09 9:33 
GeneralRe: Exit Message Box Pin
«_Superman_»1-Nov-09 9:46
professional«_Superman_»1-Nov-09 9:46 
GeneralRe: Exit Message Box Pin
MrMcIntyre1-Nov-09 9:57
MrMcIntyre1-Nov-09 9:57 
GeneralRe: Exit Message Box Pin
«_Superman_»1-Nov-09 10:00
professional«_Superman_»1-Nov-09 10:00 
GeneralRe: Exit Message Box Pin
MrMcIntyre1-Nov-09 10:04
MrMcIntyre1-Nov-09 10:04 

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.