Article View: borland.public.cppbuilder.nativeapi
Article #3345Re: Detecting media insertion/removal
From: Mike Wynne
Date: Wed, 28 Jun 2006 18:50
Date: Wed, 28 Jun 2006 18:50
26 lines
2101 bytes
2101 bytes
"Remy Lebeau (TeamB)" wrote...
> Did you try it yet? You did say that the reader is creating new drive
> letters for the media. Drive letters represent volumes, afterall.
I tried the following initialisation code:
HDEVNOTIFY hDevNotify;
DEV_BROADCAST_VOLUME NotificationFilter;
memset( &NotificationFilter, 0, sizeof(NotificationFilter) );
NotificationFilter.dbcv_size = sizeof(DEV_BROADCAST_VOLUME);
NotificationFilter.dbcv_devicetype = DBT_DEVTYP_VOLUME;
NotificationFilter.dbcv_unitmask=0x0f;
NotificationFilter.dbcv_flags=DBTF_MEDIA;
hDevNotify = RegisterDeviceNotification( Application->Handle,
&NotificationFilter,
DEVICE_NOTIFY_WINDOW_HANDLE);
However the RegisterDeviceNotification() fails with error code 13, which I
believe is "Invalid Data". What am I doing wrong?
Thanks,
MikeW
Technical Details
Message-ID:
<44a2cf86$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!reader.uucp.at!feeder02.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mailReferences:
<44a17fbc$1@newsgroups.borland.com> <44a1a4e8$1@newsgroups.borland.com> <44a1aa53@newsgroups.borland.com> <44a1c9cc$1@newsgroups.borland.com> <44a22030@newsgroups.borland.com> <44a2a037$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e15854a90a45465d X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Mike Wynne" <mikeywyn@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <44a17fbc$1@newsgroups.borland.com> <44a1a4e8$1@newsgroups.borland.com> <44a1aa53@newsgroups.borland.com> <44a1c9cc$1@newsgroups.borland.com> <44a22030@newsgroups.borland.com> <44a2a037$1@newsgroups.borland.com> Subject: Re: Detecting media insertion/removal Date: Wed, 28 Jun 2006 19:50:48 +0100 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Rfc2646: Format=Flowed; Original NNTP-Posting-Host: 62.188.49.47 Message-ID: <44a2cf86$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1151520646 62.188.49.47 (28 Jun 2006 11:50:46 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!reader.uucp.at!feeder02.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail