|
Hello everyone,
How to get the performance counter index and name relationship? Is there a table?
(like integer 180 for working set counter)
I can not find from MSDN,
http://msdn2.microsoft.com/en-us/library/aa372648.aspx
thanks in advance,
George
|
|
|
|
|
Are there situations where you cannot refer to an item by its name? The performance API allows you to construct counters using a name. If I've misunderstood your question, please explain.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi DavidCrow,
I am reading some other people's code and it has a list of numbers (performance counter index), so I have to know how to get name by index.
regards,
George
|
|
|
|
|
But how do you know there is a corresponding name?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks DavidCrow,
I only know a rough name from perfmon tool, and I do not know whether it is exactly the same name which could be used to find the index by the API, and I think the API should do exact name match, right?
regards,
George
|
|
|
|
|
George_George wrote: ...right?
Until you can provide an example where a name is used in place of a number, I've no idea.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi DavidCrow,
I have found the result by,
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\LangId
regards,
George
|
|
|
|
|
Since my machine uses English, it would be:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009\Counter
Now that you've "found" this, what exactly does it help you do that was not possible before?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry DavidCrow,
English is not my native language. You mentioned "what exactly does it help you do that was not possible before?", do you mean what objectives could I achive if I know the mapping between index and name of performance counter?
If I do not understand your points correctly, please say the sentence in some other words.
regards,
George
|
|
|
|
|
George_George wrote: ...do you mean what objectives could I achive if I know the mapping between index and name of performance counter?
Yes. I've done plenty of performance counter code, but have never needed such information. I don't do non-English stuff, however.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi DavidCrow,
Do you have an email address, I can send you the sample code I am learning if you are interested.
regards,
George
|
|
|
|
|
hi all,
I have a MFC work space which i m trying to build on WDK. Hence writing make file and sources file.In VC++ workspace i have an included directory (C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MFC\SRC)at the path Tools->Options->Directories-IncludeFiles. Now i want to include this path in my sources file to get it worked on WDK. I tried to include this path under INCLUDES part of the sources file but probably i didn't know the actual format of mentioning this path. can somebody help me out to include this mentioned path in my sources file..?
Thanks in Advance
kathir
|
|
|
|
|
Hi, all
I download and installed platform SDK.
Some project in this SDK\sample, but I can not open these sample, because these samples have not *.sln or *.dsw file but have a makefile.
So, how can I open the makefile by Visual Studio 2005 (VC8)
|
|
|
|
|
|
AFAIK, VS doesn't have a built-in utility to make a project from a makefile.
That means you'd have to parse it yourself (open in a text editor and see
what files and compiler/linker settings are used).
If you don't want to go through that trouble, you can build them from the
command line...
Open a DOS box, go to the visual c/bin folder and run vcvars32.bat (for 32-bit builds):
Setting the Path and Environment Variables for Command-Line Builds[^]
Then, without closing the command window, go to the folder with the makefile and run nmake.
That should build the samples
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Experts,
How can I change the file attribute?
for e.g. a file is read only, How can I change this?
Thanks in advance.
|
|
|
|
|
|
Just adding to Steve's reply:
The Win32 way: (Simplest)
::SetFileAttributes(_T("E:\\myfile.txt"), FILE_ATTRIBUTE_NORMAL));
The MFC Way:
CFileStatus Cfs;
CFile::GetStatus(_T("E:\\myfile.txt"), Cfs);
Cfs.m_attribute = 0;
CFile::SetStatus(_T("E:\\myfile.txt"), Cfs);
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
what's the order of evaluation here ?
int res = fn(ar[i++] | ar[i++]);
should it be:
1. temp1 = ar[i]
2. inc i
3. temp2 = ar[i]
4. inc i
5. return fn(temp1 | temp2)
or:
1. temp1 = ar[i]
2. temp2 = ar[i]
3. inc i
4. inc i
5. return fn(temp1 | temp2)
this is the code i'm actually, using
res = fn((fn2(ar[i++]) << 4) | (fn2(ar[i++]) & 0x0f));
... but that's essentially the same, right ?
i get the first behavior from VC6 debug and release and from VS05, debug. in VS05 release, i get the second behavior. unfortunately, i haven't been able to duplicate it in a small test app - in my test apps, i get the behavior in all debug builds, and the second for all release builds.
which is right? or is this one of those undefined situations ?
modified on Monday, January 21, 2008 9:21:00 PM
|
|
|
|
|
Have you looked at the .asm code to see what that reveals?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
From section 5.4 of the C++ standard:
"Except where noted, the order of evaluation of operands of individual operators and subexpressions of individual expressions, and the order in which side effects take place, is unspecified."
In section 1.3.13 you'll find the definition of unspecified behaviour:
"behavior, for a well-formed program construct and correct data, that depends on the implementation. The implementation is not required to document which behavior occurs. [Note: usually, the range of possible behaviors is delineated by this International Standard. ]"
Steve
|
|
|
|
|
I dont think both things are same.
in first case 'i' will be incremented after the entire statement.
in second case i will be incremented after first fn2() call.
Is this right??
Have you tried
only int res = fn(ar[i++] | ar[i++]); this scenario in all VS environments??
modified on Tuesday, January 22, 2008 5:37:49 AM
|
|
|
|
|
Hi, I was wondering how I may go about reading in a raw AVI file, as I have one and would like to convert it to another format such as WMV3. Are there any recommended libraries for this sort of work?
Thanks
|
|
|
|
|
the simplest way to read an AVI is with AVIFileOpen (and its many friends). if you need more than simple frame extraction, you'll need to take a look at DirectShow (or whatever MS calls it these days).
|
|
|
|
|
Hello, I have tried to use the following code in order to get the caret position from another applications windows
dwCaretID = GetWindowThreadProcessId(hCaret,NULL);
if (AttachThreadInput(dwCurrentID,dwCaretID,TRUE))
{
GUITHREADINFO lpgui;
lpgui.cbSize = sizeof(GUITHREADINFO);
GetGUIThreadInfo(dwCaretID,&pgui);
RECT caret_rect = lpgui.rcCaret;
}
The caret position is being retrieved successfully in some of the applications I tested, but in Internet Explorer although I get the caret window, the caret rect is (0,0,0,0).
Does somebody have an idea how can I get the right position?
Thank you very much.
T.R.
|
|
|
|