|
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.
|
|
|
|
|
I thought IE used "windowless controls". Can you see the controls window using SPY++ ?
|
|
|
|
|
|
|
I had the code somewhere for fiquiring when a year was a Leap Year, but I can't find it anywhere(C++). Could someone please show me how to figuire it(MFC)?
Thanks in advance.
A C++ programming language novice, but striving to learn
|
|
|
|
|
not code but this is how to calculate leap years:
A year will be a leap year if it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100, it is not a leap year unless it is also divisible by 400.
Thus years such as 1996, 1992, 1988 and so on are leap years because they are divisible by 4 but not by 100. For century years, the 400 rule is important. Thus, century years 1900, 1800 and 1700 while all still divisible by 4 are also exactly divisible by 100. As they are not further divisible by 400, they are not leap years.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Do you need to calculate leap year or do you need to determine if leap year to perform other calculations (Age, difference, etc...)?
If yes to first, www.wikipedia.org has all the mathematical and historical details.
If yes to the latter, use COleDateTime as it will do all the calculations for you. It can be used to validate a date as well.
|
|
|
|