Click here to Skip to main content
16,004,828 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionButtons in CListCtrl icon style Pin
RoyceF10-Dec-05 16:25
RoyceF10-Dec-05 16:25 
AnswerRe: Buttons in CListCtrl icon style Pin
Rajesh R Subramanian11-Dec-05 17:31
professionalRajesh R Subramanian11-Dec-05 17:31 
GeneralRe: Buttons in CListCtrl icon style Pin
RoyceF12-Dec-05 4:44
RoyceF12-Dec-05 4:44 
Questionabout the CPictureEx Pin
blackeye200410-Dec-05 15:10
blackeye200410-Dec-05 15:10 
Questiongetting disk throughput Pin
T1TAN10-Dec-05 11:54
T1TAN10-Dec-05 11:54 
QuestionRe: getting disk throughput Pin
David Crow10-Dec-05 16:38
David Crow10-Dec-05 16:38 
AnswerRe: getting disk throughput Pin
T1TAN11-Dec-05 21:32
T1TAN11-Dec-05 21:32 
GeneralRe: getting disk throughput Pin
David Crow12-Dec-05 3:28
David Crow12-Dec-05 3:28 
T1TAN wrote:
LogicalDisk|PhysicalDisk\Disk Bytes/sec


It would look something like:

HQUERY hQuery = NULL;
PDH_STATUS pdhStatus = PdhOpenQuery(NULL, 0, &hQuery);
 
// Make counter path            
PDH_COUNTER_PATH_ELEMENTS pdhCpe;
pdhCpe.szMachineName    = TEXT("server");
pdhCpe.szObjectName     = TEXT("LogicalDisk");
pdhCpe.szInstanceName   = TEXT("C:");
pdhCpe.szParentInstance = NULL;
pdhCpe.dwInstanceIndex  = -1;
pdhCpe.szCounterName    = TEXT("Disk Bytes/sec");
DWORD dwBufferSize = sizeof(szBytesSec);
TCHAR szBytesSec[128];
pdhStatus = PdhMakeCounterPath(&pdhCpe, szBytesSec, &dwBufferSize, 0);
 
// Add counter
HCOUNTER hBytesSec;
pdhStatus = PdhAddCounter(hQuery, szBytesSec, 0, &hBytesSec);
 
// Get the data
pdhStatus = PdhCollectQueryData(hQuery);
 
// Format counter value
PDH_FMT_COUNTERVALUE pdhfmtBytesSec;
pdhStatus = PdhGetFormattedCounterValue(hBytesSec, PDH_FMT_LONG, NULL, &pdhfmtBytesSec);
 
pdhStatus = PdhCloseQuery(hQuery);



"Take only what you need and leave the land as you found it." - Native American Proverb



-- modified at 9:28 Monday 12th December, 2005
GeneralRe: getting disk throughput Pin
T1TAN12-Dec-05 3:39
T1TAN12-Dec-05 3:39 
GeneralRe: getting disk throughput Pin
David Crow12-Dec-05 5:51
David Crow12-Dec-05 5:51 
GeneralRe: getting disk throughput Pin
T1TAN12-Dec-05 20:36
T1TAN12-Dec-05 20:36 
QuestionHow to switch a line to a handset in TAPI? Pin
Hamed Musavi10-Dec-05 10:03
Hamed Musavi10-Dec-05 10:03 
JokeImportant programming truths ;) Pin
Hamed Musavi10-Dec-05 9:37
Hamed Musavi10-Dec-05 9:37 
GeneralRe: Important programming truths ;) Pin
Lord Kixdemp10-Dec-05 18:21
Lord Kixdemp10-Dec-05 18:21 
GeneralRe: Important programming truths ;) Pin
Alex Orovetskiy10-Dec-05 19:33
Alex Orovetskiy10-Dec-05 19:33 
GeneralRe: Important programming truths ;) Pin
Lord Kixdemp10-Dec-05 19:51
Lord Kixdemp10-Dec-05 19:51 
GeneralRe: Important programming truths ;) Pin
Alex Orovetskiy10-Dec-05 20:57
Alex Orovetskiy10-Dec-05 20:57 
GeneralRe: Important programming truths ;) Pin
Tim Smith11-Dec-05 6:39
Tim Smith11-Dec-05 6:39 
GeneralRe: Important programming truths ;) Pin
Bob Stanneveld11-Dec-05 7:48
Bob Stanneveld11-Dec-05 7:48 
GeneralRe: Important programming truths ;) Pin
Hamed Musavi11-Dec-05 18:06
Hamed Musavi11-Dec-05 18:06 
GeneralRe: Important programming truths ;) Pin
Bob Stanneveld12-Dec-05 2:56
Bob Stanneveld12-Dec-05 2:56 
GeneralRe: Important programming truths ;) Pin
Hamed Musavi12-Dec-05 6:40
Hamed Musavi12-Dec-05 6:40 
GeneralRe: Important programming truths ;) Pin
Lord Kixdemp14-Dec-05 12:20
Lord Kixdemp14-Dec-05 12:20 
QuestionOpenGL 2D tutorial? Pin
Lord Kixdemp10-Dec-05 9:29
Lord Kixdemp10-Dec-05 9:29 
AnswerRe: OpenGL 2D tutorial? Pin
El Corazon10-Dec-05 11:47
El Corazon10-Dec-05 11:47 

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.