Vibrate Windows Mobile 5.0 with P/Invoke

H

hassanmushtaq

hello to all fellows
i am using VS 2003 with CF 1.0 and C#. i have pocket PC (Windows
Mobile 5.0). my task is to vibrate a pocket pc with p/invoke. i have
found a solution but it is not working in my favour. it gives me
exception Missing Method Exception
my code is
[DllImport("aygshell.dll")]
private static extern int Vibrate(int cvn,IntPtr rgvn,bool
fRepeat,uint dwTimeout);
public static bool Play()
{
int result = Vibrate(0, IntPtr.Zero, true, 0xffffffff);

if(result!=0)
{
return false;
}
return true;
}

[DllImport("aygshell.dll")]
private static extern int vibrateStop();
public static bool Stop()
{
int result = vibrateStop();

if(result!=0)
{
return false;
}
return true;
}
but when i call play() for vibration MissingMethod Exception occurs.
can anyone give me solution
regards
Hassan Mushtaq
 
H

hassanmushtaq

The Vibrate API is only for Smartphones. You can use the Notification LED
driver for vibrating a Pocket PC.http://msdn2.microsoft.com/en-us/library/aa917805.aspx

OpenNETCF made some nice wrappers for it in their Smart Device Framework
(OpenNETCF.Notification.Led)

--
Regards,
Christian Resma Hellehttp://christian-helle.blogspot.com




hello to all fellows
i am using VS 2003 with CF 1.0 and C#. i have pocket PC (Windows
Mobile 5.0). my task is to vibrate a pocket pc with p/invoke. i have
found a solution but it is not working in my favour. it gives me
exception Missing Method Exception
my code is
[DllImport("aygshell.dll")]
private static extern int Vibrate(int cvn,IntPtr rgvn,bool
fRepeat,uint dwTimeout);
public static bool Play()
{
int result = Vibrate(0, IntPtr.Zero, true, 0xffffffff);
if(result!=0)
{
return false;
}
return true;
}
[DllImport("aygshell.dll")]
private static extern int vibrateStop();
public static bool Stop()
{
int result = vibrateStop();
if(result!=0)
{
return false;
}
return true;
}
but when i call play() for vibration MissingMethod Exception occurs.
can anyone give me solution
regards
Hassan Mushtaq- Hide quoted text -

- Show quoted text -

hi and thanks to turning me in right direction.
in this microsoft link i have looked many times but i can't be able to
implement them. so can u help me to implementing me this Notification
LED driver.
and i can't use OpenNETCF dll so please i m waiting for ur solution
regards
hassan mushtaq
 
C

Christian Resma Helle

hi hassan,

I don't understand why you can use the SDF? The community edition is free. I
don't mind helping you implement it, but I don't see the need to re-invent
the wheel...

--
Regards,
Christian Resma Helle
http://christian-helle.blogspot.com


The Vibrate API is only for Smartphones. You can use the Notification LED
driver for vibrating a Pocket
PC.http://msdn2.microsoft.com/en-us/library/aa917805.aspx

OpenNETCF made some nice wrappers for it in their Smart Device Framework
(OpenNETCF.Notification.Led)

--
Regards,
Christian Resma Hellehttp://christian-helle.blogspot.com




hello to all fellows
i am using VS 2003 with CF 1.0 and C#. i have pocket PC (Windows
Mobile 5.0). my task is to vibrate a pocket pc with p/invoke. i have
found a solution but it is not working in my favour. it gives me
exception Missing Method Exception
my code is
[DllImport("aygshell.dll")]
private static extern int Vibrate(int cvn,IntPtr rgvn,bool
fRepeat,uint dwTimeout);
public static bool Play()
{
int result = Vibrate(0, IntPtr.Zero, true, 0xffffffff);
if(result!=0)
{
return false;
}
return true;
}
[DllImport("aygshell.dll")]
private static extern int vibrateStop();
public static bool Stop()
{
int result = vibrateStop();
if(result!=0)
{
return false;
}
return true;
}
but when i call play() for vibration MissingMethod Exception occurs.
can anyone give me solution
regards
Hassan Mushtaq- Hide quoted text -

- Show quoted text -

hi and thanks to turning me in right direction.
in this microsoft link i have looked many times but i can't be able to
implement them. so can u help me to implementing me this Notification
LED driver.
and i can't use OpenNETCF dll so please i m waiting for ur solution
regards
hassan mushtaq
 
C

Christian Resma Helle

Hi Hassan,

I forgot to mention that the source code for the Notification LED API
wrapper is available in the SDF 1.4. You can just download the source code
for that and look for OpenNETCF.WindowsCE.Forms.Led if you really don't want
to depend on the SDF dll's

--
Regards,
Christian Resma Helle
http://christian-helle.blogspot.com


The Vibrate API is only for Smartphones. You can use the Notification LED
driver for vibrating a Pocket
PC.http://msdn2.microsoft.com/en-us/library/aa917805.aspx

OpenNETCF made some nice wrappers for it in their Smart Device Framework
(OpenNETCF.Notification.Led)

--
Regards,
Christian Resma Hellehttp://christian-helle.blogspot.com




hello to all fellows
i am using VS 2003 with CF 1.0 and C#. i have pocket PC (Windows
Mobile 5.0). my task is to vibrate a pocket pc with p/invoke. i have
found a solution but it is not working in my favour. it gives me
exception Missing Method Exception
my code is
[DllImport("aygshell.dll")]
private static extern int Vibrate(int cvn,IntPtr rgvn,bool
fRepeat,uint dwTimeout);
public static bool Play()
{
int result = Vibrate(0, IntPtr.Zero, true, 0xffffffff);
if(result!=0)
{
return false;
}
return true;
}
[DllImport("aygshell.dll")]
private static extern int vibrateStop();
public static bool Stop()
{
int result = vibrateStop();
if(result!=0)
{
return false;
}
return true;
}
but when i call play() for vibration MissingMethod Exception occurs.
can anyone give me solution
regards
Hassan Mushtaq- Hide quoted text -

- Show quoted text -

hi and thanks to turning me in right direction.
in this microsoft link i have looked many times but i can't be able to
implement them. so can u help me to implementing me this Notification
LED driver.
and i can't use OpenNETCF dll so please i m waiting for ur solution
regards
hassan mushtaq
 
H

hassanmushtaq

Hi Hassan,

I forgot to mention that the source code for the Notification LED API
wrapper is available in the SDF 1.4. You can just download the source code
for that and look for OpenNETCF.WindowsCE.Forms.Led if you really don't want
to depend on the SDF dll's

--
Regards,
Christian Resma Hellehttp://christian-helle.blogspot.com


The Vibrate API is only for Smartphones. You can use the Notification LED
driver for vibrating a Pocket
PC.http://msdn2.microsoft.com/en-us/library/aa917805.aspx
OpenNETCF made some nice wrappers for it in their Smart Device Framework
(OpenNETCF.Notification.Led)
news:51aca1e0-b2b3-4492-a258-44e046c9c0a2@o77g2000hsf.googlegroups.com...
hello to all fellows
i am using VS 2003 with CF 1.0 and C#. i have pocket PC (Windows
Mobile 5.0). my task is to vibrate a pocket pc with p/invoke. i have
found a solution but it is not working in my favour. it gives me
exception Missing Method Exception
my code is
[DllImport("aygshell.dll")]
private static extern int Vibrate(int cvn,IntPtr rgvn,bool
fRepeat,uint dwTimeout);
public static bool Play()
{
int result = Vibrate(0, IntPtr.Zero, true, 0xffffffff);
if(result!=0)
{
return false;
}
return true;
}
[DllImport("aygshell.dll")]
private static extern int vibrateStop();
public static bool Stop()
{
int result = vibrateStop();
if(result!=0)
{
return false;
}
return true;
}
but when i call play() for vibration MissingMethod Exception occurs.
can anyone give me solution
regards
Hassan Mushtaq- Hide quoted text -
- Show quoted text -

hi and thanks to turning me in right direction.
in this microsoft link i have looked many times but i can't be able to
implement them. so can u help me to implementing me this Notification
LED driver.
and i can't use OpenNETCF dll so please i m waiting for ur solution
regards
hassan mushtaq- Hide quoted text -

- Show quoted text -

thanks alot chiristian resma. i have solved the problem....
 
H

Hilton

Why not just: "return result == 0;

....or:

return Vibrate(0, IntPtr.Zero, true, 0xffffffff) == 0;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top