yeshengl
asked on
GetCurrentHwProfile, HW_PROFILE_INFO won't compile!
Hi,
I tried to use GetCurrentHwProfile(&hwp) and HW_PROFILE_INFO hwp. I already included windows.h. But they just won't compile. The compiler tells:
'HW_PROFILE_INFO' : undeclared identifier
'GetCurrentHwProfile' : undeclared identifier
So what is the problem and how can I make them compile. Thanks a lot!
I tried to use GetCurrentHwProfile(&hwp) and HW_PROFILE_INFO hwp. I already included windows.h. But they just won't compile. The compiler tells:
'HW_PROFILE_INFO' : undeclared identifier
'GetCurrentHwProfile' : undeclared identifier
So what is the problem and how can I make them compile. Thanks a lot!
ASKER
Are you able to include windows.h without any problems? (You should be)
Yes, I am able to include windows.h
Are HW_PROFILE_INFO and GetCurrentHwProfile somehow defined in windows.h? (They should be)
No. Actually HW_PROFILE_INFO and GetCurrentHwProfile are defined in winbase.h. From the MSDN, you can see their including information as: Header: Declared in Winbase.h; include Windows.h.
And I included both windows.h and winbase.h, it still does not compile.
The HW_PROFILE_INFO hwp; line is before GetCurrentHwProfile, right? (It should be)
Yes. It is like this:
HW_PROFILE_INFO HwProfInfo;
if (!GetCurrentHwProfile(&HwP rofInfo))
{
_tprintf(TEXT("GetCurrentH wProfile failed with error %lx\n"),
GetLastError());
return;
}
But it won't compile. The compile error:
error C2065: 'HW_PROFILE_INFO' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'HwProfInfo'
error C2065: 'HwProfInfo' : undeclared identifier
error C2065: 'GetCurrentHwProfile' : undeclared identifier
Yes, I am able to include windows.h
Are HW_PROFILE_INFO and GetCurrentHwProfile somehow defined in windows.h? (They should be)
No. Actually HW_PROFILE_INFO and GetCurrentHwProfile are defined in winbase.h. From the MSDN, you can see their including information as: Header: Declared in Winbase.h; include Windows.h.
And I included both windows.h and winbase.h, it still does not compile.
The HW_PROFILE_INFO hwp; line is before GetCurrentHwProfile, right? (It should be)
Yes. It is like this:
HW_PROFILE_INFO HwProfInfo;
if (!GetCurrentHwProfile(&HwP
{
_tprintf(TEXT("GetCurrentH
GetLastError());
return;
}
But it won't compile. The compile error:
error C2065: 'HW_PROFILE_INFO' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'HwProfInfo'
error C2065: 'HwProfInfo' : undeclared identifier
error C2065: 'GetCurrentHwProfile' : undeclared identifier
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are HW_PROFILE_INFO and GetCurrentHwProfile somehow defined in windows.h? (They should be)
The HW_PROFILE_INFO hwp; line is before GetCurrentHwProfile, right? (It should be)