Click here to Skip to main content
15,917,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Forground Window in WinXP and Win7 both Pin
rahul.kulshreshtha29-May-10 0:21
rahul.kulshreshtha29-May-10 0:21 
QuestionInstall IIS Pin
gothic_coder28-May-10 21:39
gothic_coder28-May-10 21:39 
AnswerRe: Install IIS Pin
Hristo-Bojilov29-May-10 0:16
Hristo-Bojilov29-May-10 0:16 
GeneralRe: Install IIS Pin
gothic_coder29-May-10 0:39
gothic_coder29-May-10 0:39 
GeneralRe: Install IIS Pin
Hristo-Bojilov29-May-10 0:47
Hristo-Bojilov29-May-10 0:47 
GeneralRe: Install IIS Pin
gothic_coder29-May-10 0:53
gothic_coder29-May-10 0:53 
GeneralRe: Install IIS Pin
gothic_coder3-Jun-10 0:17
gothic_coder3-Jun-10 0:17 
QuestionWhy C++ doesn't use the parent's class function? (C++ question) Pin
Green Fuze28-May-10 21:10
Green Fuze28-May-10 21:10 
AnswerRe: Why C++ doesn't use the parent's class function? (C++ question) Pin
Green Fuze28-May-10 21:11
Green Fuze28-May-10 21:11 
GeneralRe: Why C++ doesn't use the parent's class function? (C++ question) Pin
eusto28-May-10 23:20
eusto28-May-10 23:20 
GeneralRe: Why C++ doesn't use the parent's class function? (C++ question) Pin
Green Fuze29-May-10 1:33
Green Fuze29-May-10 1:33 
GeneralRe: Why C++ doesn't use the parent's class function? (C++ question) Pin
eusto29-May-10 8:44
eusto29-May-10 8:44 
Questionproblem with creating model-less dialog as a child of CFormView Pin
m_code28-May-10 18:54
m_code28-May-10 18:54 
AnswerRe: problem with creating model-less dialog as a child of CFormView Pin
Richard MacCutchan28-May-10 22:26
mveRichard MacCutchan28-May-10 22:26 
GeneralRe: problem with creating model-less dialog as a child of CFormView Pin
m_code29-May-10 8:39
m_code29-May-10 8:39 
Questionabout Hook WriteProcessMemory Pin
rockago28-May-10 12:30
rockago28-May-10 12:30 
AnswerRe: about Hook WriteProcessMemory Pin
Garth J Lancaster28-May-10 14:02
professionalGarth J Lancaster28-May-10 14:02 
GeneralRe: about Hook WriteProcessMemory Pin
rockago28-May-10 14:23
rockago28-May-10 14:23 
GeneralRe: about Hook WriteProcessMemory Pin
Garth J Lancaster28-May-10 15:07
professionalGarth J Lancaster28-May-10 15:07 
GeneralRe: about Hook WriteProcessMemory Pin
rockago28-May-10 21:48
rockago28-May-10 21:48 
GeneralRe: about Hook WriteProcessMemory Pin
Garth J Lancaster28-May-10 22:27
professionalGarth J Lancaster28-May-10 22:27 
AnswerRe: about Hook WriteProcessMemory Pin
Richard MacCutchan28-May-10 22:22
mveRichard MacCutchan28-May-10 22:22 
GeneralRe: about Hook WriteProcessMemory Pin
Garth J Lancaster28-May-10 22:33
professionalGarth J Lancaster28-May-10 22:33 
GeneralRe: about Hook WriteProcessMemory Pin
Richard MacCutchan28-May-10 23:09
mveRichard MacCutchan28-May-10 23:09 
QuestionWrite a function to cause a thread to wait Pin
Danzy8328-May-10 9:08
Danzy8328-May-10 9:08 
Hi, I have written a function to cause a thread to wait for a given time. But the problem is that If this function is called, I notice from task manager (in Windows) that the CPU Usage shoots up to 100 percent. But if I rather use the Windows function Sleep(), the CPU Usage falls back to around 2%, 3%, and 4%. The following is how I wrote the function, with the header file <time.h> included.



void Wait(clock_t milliseconds)
{
clock_t delay_time = milliseconds + clock();

while (delay_time > clock())
;

return;
}


I don't know why my CPU usage shoots up to 100% when I use this function rather than Windows Sleep() function. I don't want my application to assume the use of Windows. Please help.

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.