Reputation: 51
I want to import uxtheme
to my c program and use some variable types that are in uxtheme.h
library.
When I use this and compile my project, my computer shows me some unreasonable error. Like this:
unknown type name 'DTTOPTS'
But I am sure that DTTOPTS
is defined in uxtheme.h
.
Why my PC shows me this error and how I can resolve it?
My Codes:
#include <studio.h>
#include <windows.h>
#include <uxtheme.h>
int main(){
DTTOPTS d;
return 0;
}
Upvotes: 1
Views: 546
Reputation: 51499
The DTTOPTS structure is conditionally defined, if the target OS is set to Windows Vista (or later). Using the Windows Headers explains, which preprocessor symbols need to be defined.
You can #define _WIN32_WINNT 0x0600
in your code (prior to including Windows SDK header files) to make the structure visible to the compiler. Ideally, you would set the preprocessor symbol on the command line, e.g. /D_WIN32_WINNT=0x0600
, so that all your code gets to agree on the same target version.
Upvotes: 1