1

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;
}
Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
Tony
  • 51
  • 7
  • When creating a [mcve], please make sure it doesn't contain any other unrelated errors. And especially don't rewrite it into the question, copy-paste it instead. That way you don't add typos (like your code have). Also please include the *full* and *complete* output of the build in the question, as there might be informational notes that contain hints about the problem. Lastly please take some time to read about [how to ask good questions](http://stackoverflow.com/help/how-to-ask) and [this question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). – Some programmer dude Jan 13 '20 at 10:11
  • Try visual studio. – Michael Chourdakis Jan 14 '20 at 22:31
  • Is `studio.h` a typo which means `stdio.h`? if so, it works for me with sdk version 10.0.18362.0 – Drake Wu Jan 15 '20 at 03:40

1 Answers1

1

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.

IInspectable
  • 46,945
  • 8
  • 85
  • 181