Windows Phone Thoughts: Two for the Road Continues

Be sure to register in our forums! Share your opinions, help others, and enter our contests.


Digital Home Thoughts

Loading feed...

Laptop Thoughts

Loading feed...

Android Thoughts

Loading feed...



Saturday, November 9, 2002

Two for the Road Continues

Posted by Andy Sjostrom in "DEVELOPER" @ 02:34 AM

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnroad/html/road11132002.asp

Visitor Pamela Mackey said she'd like to see more attention paid to the "Two for the Road" developer series by Larry Roof and John Kennedy. These guys do get many developers started on the news tools. Head on over there and see C# being used to program smart devices!

"It's surprisingly easy to use older API functions. Here's an example class that wraps the sndPlaySound API.

using System.Runtime.InteropServices;

public class Win32{
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
public static extern bool sndPlaySound(String lpszSoundname, uint fuSound);
}

You can see that it declares the new class member using the same parameters as the original API, and references the DLL coredll.dll that is in the ROM of every Pocket PC device. To make use of this function in your C# code, you only need to use a line like this:

Win32.sndPlaySound("Alarm1",0);

And it plays the correct WAV file."

Tags:

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...