I tried to use the code on MSDN to create Rawinput but i kept getting this error: RAWINPUTDEVICE was not declared in this scope.

I am writing in c++ and direct x and i am using Code Blocks

void RawInput(void)
{
    RAWINPUTDEVICE Rid[2];

    //keyboard
    Rid[0] .usUsagePage = 1;
    Rid[0] .usUsage = 6;
    Rid[0] .dwFlags = 0;
    Rid[0] .hwndTarget = NULL;

    //mouse
    Rid[1] .usUsagePage = 1;
    Rid[1] .usUsage = 2;
    Rid[1] .dwFlags = 0;
    Rid[1] .hwndTarget = NULL;
}

i am writing this in a function is this wrong?

anyway i really need your help thanks!

The issue is because the value of _WIN32_WINNT is below 0x0501. When I compile in Code::Blocks I get the same problem, but if I compile in Visual Studio C++ then I no longer have the problem. This is because the version of MinGW that comes with Code::Blocks is giving _WIN32_WINNT me a value of 0x0400 whereas Visual Studio is giving me 0x0601.

The solution to this is to manually define WINVER and _WIN32_WINNT to 0x0601, install the latest version of MinGW (manually, because I tried the automatic installer and it didn't seem to do anything) or convert to the darkside and use Visual Studio.

If you are going to do some game development (I am assuming you are because you are playing around with DirectX) I would suggest using Visual Studio because I have ran into many problems trying to get stuff working with MinGW (NVIDIA PhysX SDK couldn't find lots of stuff).

Cheers for the help I'll try out visual studio

Can I use the free version for game development or do I have to pay for the full version

From what I read on the Visual Studio Wiki there should be no major limitations by using the Express edition opposed to Ultimate or something you would pay for.

There are a few things in Visual C++ that I found annoying like the pre-compiled headers but most of that can be modified in the 'Project > "projectname" Properties...' section.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.