How can I use the types WORD, UCHAR, ULONG, USHORT in C++?

c++, visual-studio-2010, windows

Solution

These types are defined in `windows.h`, so you need to put `#include <windows.h>` somewhere.

In your case, you probably need to put it in before the header of the external library you're mentioning:

#include <windows.h>
// Possibly other stuff here...
#include <external-library.h>

Problem

I have created a Win32 Console Project in Visual Studio 2010. In this project I would like to use an external library with corresponding headers. The header files includes variables declared as - UCHAR - ULONG - USHORT - WORD stated as above in captitals. Having done very little programming in C++, I don't recognise these types and I do get errors for each line of code containing them: ``` WORD myVariable; ``` Error: error C2146: syntax error : missing ';' before identifier 'myVariable' This is probably a very simple thing, but would like some help to increase my C++ knowledge. What do I need to be able to use these types?

Original source