For Programmers: Free Programming Magazines  


Home > Archive > Smartphone Developer Forum > January 2006 > can't get vibration to work









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author can't get vibration to work
Maik Wiege

2006-01-16, 7:11 pm

Hello!
I try to let my WM5 mobile vibrate, but I can't get it to work. Here is
what I have done:

int i = VibrateGetDeviceCaps(VDC_AMPLITUDE);
int j = VibrateGetDeviceCaps(VDC_FREQUENCY);
HRESULT hr = Vibrate (0, NULL, TRUE, INFINITE);
if (hr == E_FAIL)
MessageBox(_T("FAIL"));

i and j get the (strange) value of -2147467263 and the messagebox is
showing, so the return value is E_FAIL.

What am I doing wrong?

Thanks for any help
Maik
Peter Foot [MVP]

2006-01-17, 4:01 am

What device are you using?

Peter

--
Peter Foot
Windows Embedded MVP
www.peterfoot.net | www.inthehand.com

"Maik Wiege" <mswiege*nospam*@gmx.de> wrote in message
news:uGGfuHvGGHA.344@TK2MSFTNGP09.phx.gbl...
> Hello!
> I try to let my WM5 mobile vibrate, but I can't get it to work. Here is
> what I have done:
>
> int i = VibrateGetDeviceCaps(VDC_AMPLITUDE);
> int j = VibrateGetDeviceCaps(VDC_FREQUENCY);
> HRESULT hr = Vibrate (0, NULL, TRUE, INFINITE);
> if (hr == E_FAIL)
> MessageBox(_T("FAIL"));
>
> i and j get the (strange) value of -2147467263 and the messagebox is
> showing, so the return value is E_FAIL.
>
> What am I doing wrong?
>
> Thanks for any help
> Maik



Maik Wiege

2006-01-17, 7:07 pm

Peter Foot [MVP] schrieb:
> What device are you using?
>

Thanks for your responce!
I have an O2 XDA Mini S (I think only available in Germany), but yes it
has build in vibration if that was the question yor were pointing at.
And remember I get the E_FAIL and not the E_NOTIMPL error.

Any other ideas?
Peter Foot [MVP]

2006-01-17, 7:07 pm

The Vibration APIs are supported on Smartphone only. On Pocket PC the
vibration feature is implemented as a notification LED instead. Therefore
you'll need to use NLed.h functionality. Once you have retrieved the count
of LEDs you'll usually find that the last one is the vibration motor.

Peter

--
Peter Foot
Windows Embedded MVP
www.peterfoot.net | www.inthehand.com

"Maik Wiege" <mswiege*nospam*@gmx.de> wrote in message
news:ukEaHE3GGHA.2064@TK2MSFTNGP09.phx.gbl...
> Peter Foot [MVP] schrieb:
> Thanks for your responce!
> I have an O2 XDA Mini S (I think only available in Germany), but yes it
> has build in vibration if that was the question yor were pointing at. And
> remember I get the E_FAIL and not the E_NOTIMPL error.
>
> Any other ideas?



Maik Wiege

2006-01-17, 7:07 pm

Peter Foot [MVP] schrieb:
> The Vibration APIs are supported on Smartphone only. On Pocket PC the
> vibration feature is implemented as a notification LED instead. Therefore
> you'll need to use NLed.h functionality. Once you have retrieved the count
> of LEDs you'll usually find that the last one is the vibration motor.
>
> Peter
>

Thanks for the info! The funny thing is, that the device is a smartphone
(or am I mixing something up? I thought, a Pocket PC is Smartphone
without the capability to call. And my device IS a mobile with
touchscreen and Windows Media 5 - or what exactly is the difference
between smartphone and pocket pc?)
To your suggestion: The problem is: in the smartphone SDK the NLed.h is
missing (as posted in a later thread) and as you there suggested, I will
try to use the PocketPC SDK for this (am currently downloading). I will
post the results of the test here!
So could someone be so nice and tell me quick what the difference
betwewn PPC and Smartphone is, so I will know it for the future.

Thank so far
Maik
riki

2006-01-17, 9:57 pm

Maik Wiege wrote:
> So could someone be so nice and tell me quick what the difference
> betwewn PPC and Smartphone is, so I will know it for the future.


if it has a touch screen it's a PocketPC.

thats the quick and dirty version.

riki

I poured beer on my lawn and it came up half cut!
By Night:
ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
AbstractStart for Smartphone :
http://homepages.inspire.net.nz/~gambit/AbstractStart/
Latest Betas have WM5 layout and speed dial support
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com