Click here to Skip to main content
15,888,984 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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.
AnswerRe: Write a function to cause a thread to wait Pin
CPallini28-May-10 9:19
mveCPallini28-May-10 9:19 
AnswerRe: Write a function to cause a thread to wait Pin
Luc Pattyn28-May-10 9:33
sitebuilderLuc Pattyn28-May-10 9:33 
AnswerRe: Write a function to cause a thread to wait Pin
Cedric Moonen28-May-10 10:02
Cedric Moonen28-May-10 10:02 
GeneralRe: Write a function to cause a thread to wait Pin
CPallini28-May-10 11:08
mveCPallini28-May-10 11:08 
AnswerRe: Write a function to cause a thread to wait Pin
malaugh28-May-10 11:18
malaugh28-May-10 11:18 
AnswerRe: Write a function to cause a thread to wait Pin
Richard MacCutchan28-May-10 22:17
mveRichard MacCutchan28-May-10 22:17 
QuestionOnPrint from IE Pin
mesajflaviu28-May-10 4:34
mesajflaviu28-May-10 4:34 
AnswerRe: OnPrint from IE Pin
mesajflaviu28-May-10 7:43
mesajflaviu28-May-10 7:43 
QuestionAllocating memory for function pointers [modified] Pin
SelvaKr28-May-10 4:08
SelvaKr28-May-10 4:08 
AnswerRe: Allocating memory for function pointers Pin
Aescleal28-May-10 4:16
Aescleal28-May-10 4:16 
GeneralRe: Allocating memory for function pointers Pin
SelvaKr28-May-10 4:41
SelvaKr28-May-10 4:41 
QuestionHow can draw a Side bar like a CodeProject Left Sidebar? Pin
Le@rner28-May-10 2:53
Le@rner28-May-10 2:53 
AnswerRe: How can draw a Side bar like a CodeProject Left Sidebar? Pin
Richard MacCutchan28-May-10 3:06
mveRichard MacCutchan28-May-10 3:06 
GeneralRe: How can draw a Side bar like a CodeProject Left Sidebar? Pin
Le@rner28-May-10 18:09
Le@rner28-May-10 18:09 
GeneralRe: How can draw a Side bar like a CodeProject Left Sidebar? Pin
Richard MacCutchan28-May-10 22:14
mveRichard MacCutchan28-May-10 22:14 
QuestionHow do i check whether a window is opened or not Win 32 Pin
arun_pk28-May-10 2:21
arun_pk28-May-10 2:21 
AnswerRe: How do i check whether a window is opened or not Win 32 Pin
Aescleal28-May-10 2:30
Aescleal28-May-10 2:30 

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.