🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2532

Re: RegisterRawInputDevices WM_INPUT ????

#2532
From: Remy Lebeau (TeamB)
Date: Fri, 09 Feb 2007 23:14
45 lines
1992 bytes
"Jonathan Dumaresq" <jdumaresq@cimeq.qc.ca_nospam> wrote in message
news:45ccf77e$1@newsgroups.borland.com...

>  void WindowProc(TMessage &msg);

TForm inherits a WindowProc property from TControl.  You cannot
declare a method with the same name.  You should override the virtual
WndProc() method instead.

>  RAWINPUTDEVICE Rid;

You should always zero out API structures before using them:

    RAWINPUTDEVICE Rid = {0};

Or

    RAWINPUTDEVICE Rid;
    memset(&Rid, 0, sizeof(Rid));

Or:

    RAWINPUTDEVICE Rid;
    ::ZeroMemory(&Rid, sizeof(Rid));

>  Rid.usUsagePage = 0x01;
>  Rid.usUsage = 0x04;
>  Rid.dwFlags = 0;                 // adds joystick
>  Rid.hwndTarget = NULL;

Why are you not setting the TForm's Handle as the target?  That is
where you are trying to catch the WM_INPUT messages, afterall.

>  if (RegisterRawInputDevices(&Rid, 1, sizeof(Rid)) == FALSE)
>  {
>    //registration failed. Call GetLastError for the cause of the
error.
>   ShowMessage("error");
>  }

You did not say which error is actually being reported.


Gambit
Technical Details
Message-ID: <45cd0089$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45ccf77e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,326f860468e16051
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <45ccf77e$1@newsgroups.borland.com>
Subject: Re: RegisterRawInputDevices WM_INPUT ????
Date: Fri, 9 Feb 2007 15:14:40 -0800
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.34.171
Message-ID: <45cd0089$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1171062921 75.83.34.171 (9 Feb 2007 15:15:21 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail