Click here to Skip to main content
15,895,656 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: IDE Bug/Problem Pin
David Crow27-Jul-04 8:09
David Crow27-Jul-04 8:09 
GeneralRe: IDE Bug/Problem Pin
sweep12327-Jul-04 22:02
sweep12327-Jul-04 22:02 
GeneralRe: IDE Bug/Problem Pin
David Crow28-Jul-04 3:58
David Crow28-Jul-04 3:58 
GeneralRe: IDE Bug/Problem Pin
sweep12328-Jul-04 6:29
sweep12328-Jul-04 6:29 
Generalcpu performance Pin
hph27-Jul-04 4:59
hph27-Jul-04 4:59 
GeneralRe: cpu performance Pin
David Crow27-Jul-04 8:05
David Crow27-Jul-04 8:05 
GeneralRe: cpu performance Pin
bikram singh27-Jul-04 8:06
bikram singh27-Jul-04 8:06 
GeneralNT: Use Performance Counters Pin
bikram singh27-Jul-04 8:09
bikram singh27-Jul-04 8:09 
HQUERY		hQuery;
HCOUNTER	hCounter;

if(ERROR_SUCCESS == PdhOpenQuery(0, 0, &hQuery))
{
 if(ERROR_SUCCESS == PdhAddCounter (hQuery,TEXT("\\Processor(0)\\% Processor Time"),0,&hCounter))
 {
  int i = 0;
  while(i < 5)
  {
   ++i;
   if(ERROR_SUCCESS == PdhCollectQueryData(hQuery))
   {
    PDH_FMT_COUNTERVALUE	val;
    if(ERROR_SUCCESS == PdhGetFormattedCounterValue(hCounter,PDH_FMT_LONG|PDH_FMT_NOSCALE,0, &val))
    {
     printf("\nCPU is at %d %%",val.longValue);
    }
   }
   Sleep(500); //wait for some time(not absolutely needed though, but better to wait some time atleast!)
  }
  PdhRemoveCounter(hCounter);
 }
 PdhCloseQuery(hQuery);
}



Bikram Singh

QuestionUpper limit of stack size increase..?? Pin
Shiva Prasad27-Jul-04 4:44
Shiva Prasad27-Jul-04 4:44 
GeneralKeeping Window On Top Pin
KingTermite27-Jul-04 3:04
KingTermite27-Jul-04 3:04 
GeneralRe: Keeping Window On Top Pin
David Crow27-Jul-04 4:01
David Crow27-Jul-04 4:01 
GeneralRe: Keeping Window On Top Pin
KingTermite27-Jul-04 8:34
KingTermite27-Jul-04 8:34 
GeneralRe: Keeping Window On Top Pin
David Crow27-Jul-04 8:47
David Crow27-Jul-04 8:47 
GeneralRe: Keeping Window On Top Pin
KingTermite27-Jul-04 10:52
KingTermite27-Jul-04 10:52 
GeneralRe: Keeping Window On Top Pin
David Crow28-Jul-04 3:46
David Crow28-Jul-04 3:46 
GeneralCDialog Help! Pin
Pazzuzu27-Jul-04 1:10
Pazzuzu27-Jul-04 1:10 
GeneralRe: CDialog Help! Pin
Ivan Cachicatari27-Jul-04 4:06
Ivan Cachicatari27-Jul-04 4:06 
GeneralRe: CDialog Help! Pin
David Crow27-Jul-04 4:06
David Crow27-Jul-04 4:06 
GeneralRe: CDialog Help! Pin
Pazzuzu27-Jul-04 4:22
Pazzuzu27-Jul-04 4:22 
GeneralRe: CDialog Help! Pin
Pazzuzu27-Jul-04 5:11
Pazzuzu27-Jul-04 5:11 
GeneralRe: CDialog Help! Pin
David Crow27-Jul-04 7:53
David Crow27-Jul-04 7:53 
GeneralRe: CDialog Help! Pin
Pazzuzu28-Jul-04 4:20
Pazzuzu28-Jul-04 4:20 
GeneralRe: CDialog Help! Pin
Jaime Stuardo27-Jul-04 5:09
Jaime Stuardo27-Jul-04 5:09 
QuestionAre parameters/member variables safe for threading ? Pin
Hesham Amin27-Jul-04 0:39
Hesham Amin27-Jul-04 0:39 
QuestionHow to add a message handler function to a control at run-time? Pin
misterbear26-Jul-04 21:48
misterbear26-Jul-04 21:48 

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.