🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #400

Re: Joystick Button Problems

#400
From: Remy Lebeau (TeamB)
Date: Thu, 09 Dec 2004 19:17
42 lines
2580 bytes
"Edward" <eduglobo2004@globo.com> wrote in message
news:41b89609@newsgroups.borland.com...

> If is illegal, why exist?

They exist because the same VCL is shared between both Delphi and BCB, but
the VCL is written in Delphi Pascal, not C++.  They are legal in Delphi,
because Delphi Pascal has different rules regarding how objects are created
than C++ does.  Being written in Pascal, the VCL in BCB follows the Delphi
rules, not the C++ rules.  That is why those events are dangerous to use in
C++ but not in Delphi.

> I can use FormActivate in the place of  FormCreate?

The OnActivate event is not a constructor.  Not only that, it can be
triggered multiple times, so you have to watch out for that.

> void __fastcall TFormPrincipal::FormClose(TObject *Sender, TCloseAction
> &Action)
<snip>
> in the place of  FormDestroy ?

The OnClose event is not always guaranteed to be triggered.  There are
situations where it is skipped, so your clean up code would not be called at
all.  That is why I told you to use the actual destructor instead.

It seems to me that you are focusing too much on the Object Inspector and
not enough on the actual code.

> Why i CAN NOT  get the butons 5,6,7 and 8 of my USB Joystick?

The message you are catching does not support those buttons in the first
place.  It only supports the first four buttons.

Rather than using the Joystick API, I would suggest you use DirectX instead,
specially DirectInput.  Microsoft even says that the Joystick API has been
superseded by DirectInput because it has more features for supporting modern
technology.


Gambit
Technical Details
Message-ID: <41b8a4c7$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41b88a74@newsgroups.borland.com> <41b88bd4$2@newsgroups.borland.com> <41b89609@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,734fce58ab6581e5
X-Google-Attributes: gid10d0fc,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.multimedia
References: <41b88a74@newsgroups.borland.com> <41b88bd4$2@newsgroups.borland.com> <41b89609@newsgroups.borland.com>
Subject: Re: Joystick  Button Problems
Date: Thu, 9 Dec 2004 11:17:45 -0800
Lines: 44
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: 68.69.17.41
Message-ID: <41b8a4c7$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1102619847 68.69.17.41 (9 Dec 2004 11:17:27 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail