Article View: borland.public.cppbuilder.nativeapi
Article #3131Re: OnDeviceChange Problem
From: Michel Leunen
Date: Tue, 17 Oct 2006 14:38
Date: Tue, 17 Oct 2006 14:38
27 lines
1657 bytes
1657 bytes
Uri wrote:
> Hi, when I connect OR disconnect the USB connector I reach the
> breakpoint in function "OnDeviceChange", but the parameters
> of 'm' are stay the same (it is not right), why?
> void TUSBApp_form::OnDeviceChange(Messages::TMessage m)
You have to test against m.WParam. Something like:
switch(m.WParam)
{
case DBT_DEVICEARRIVAL:
//a new device has been inserted
break;
case DBT_DEVICEREMOVECOMPLETE:
//a device has been removed
break;
}
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
Technical Details
Message-ID:
<4534eac1$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.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-mailReferences:
<4534d31d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a72a1c41eec7e70f X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 17 Oct 2006 16:38:36 +0200 From: Michel Leunen <nospam@noreply.be> Organization: www.leunen.com User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: OnDeviceChange Problem References: <4534d31d$1@newsgroups.borland.com> In-Reply-To: <4534d31d$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.247.83.169 Message-ID: <4534eac1$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1161095873 81.247.83.169 (17 Oct 2006 07:37:53 -0700) Lines: 27 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.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