Thread: Raw Input Registration Problems, RegisterRawInputDevices()

  1. #1
    Registered User
    Join Date
    Jan 2006
    Location
    Seattle
    Posts
    30

    Raw Input Registration Problems, RegisterRawInputDevices()

    Hi,

    I've never worked with raw input before and I'm having trouble even getting to a situation where I can receive WM_INPUT messages. I've been reading the MSDN page on raw input (link) but I'm having trouble deciphering what I actually need to do.

    Right now I have this code:

    Code:
    	RAWINPUTDEVICE rawInputDevices;
    
    	rawInputDevices.hwndTarget     = 0;
    	rawInputDevices.usUsagePage    = 0x01;
    	rawInputDevices.usUsage        = 0;
    	rawInputDevices.dwFlags	       = RIDEV_PAGEONLY;
    
    	RegisterRawInputDevices( rawInputDevices_, 1, sizeof(rawInputDevices) );
    Which from what I have seen should work but RegisterRawInputDevices always returns false and calling GetLastError() returns an error code of 998 (ERROR_NOACCESS) meaning an Invalid access to memory location. I read that the error might have something to do with AntiVirus/Firewall software but disabling my firewall returned the same results.

    Any help would be greatly appreciated, thanks.
    -Peter

    ***Edit***
    After working on this for about an hour I finally decided to seek some help. Then right after posting I saw my problem... instead of using the RID variable I just created I'm using a member variable which is still sticking around from other attempts.
    Last edited by Peter5897; 05-19-2007 at 04:11 PM. Reason: Fixed the problem...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need some help with C program writing
    By The_PC_Gamer in forum C Programming
    Replies: 9
    Last Post: 02-12-2008, 09:12 PM
  2. For loop problems, input please.
    By xIcyx in forum C Programming
    Replies: 2
    Last Post: 04-22-2007, 03:54 AM
  3. Problems with input and fflush
    By edugarcia in forum Linux Programming
    Replies: 1
    Last Post: 11-24-2004, 01:52 PM
  4. function and input problems
    By meka in forum C++ Programming
    Replies: 4
    Last Post: 09-22-2001, 11:56 AM