Freetip is a clone of Iambic’s tipper. It was an excellent start for a first C# .NET CF project. I learned the basics of Windows form programming - never did that before. In the past I only used C++ and programmed console apps. I’m still struggling with some of the basics such as classes. But I know I’ll make it through. Initially I was trying all sorts of methods to create an “Exit” button. Took me about 3 hours just to find out that all I needed was 1 line of code “Close();”. That was disheartening. Also I didn’t know that there was a control called “numericupdown”. I was using “domainupdown” and using it with an array in an attempt to do the same thing as a numericupdown.
So overall, the things I learned from this project are:
- How to close an application: Close();
- How to round up: System.Math.Ceiling(str);
- How to create a SmartDevice CAB installer.
- How to make menus.
- How to convert strings to another data type such as double or decimal.
- How to limit the number of decimal places: str.ToString(”F2″);
- How to create a dialog box: DialogResult result= MessageBox.Show(”Message”);
- How to use textbox, numericupdown, and checkbox controls as well as modifying properties of each such as “.text” or “.increment”.
As for today, I started work on Pocket Hymnal. With the LORD’s help today I learn a bit on how Microsoft SQL 2005 mobile worked as well as how to interface with FMOD for audio playback. Man that was confusing - took me about 6 hours to finally get it to work. When using the wrapper class, make sure you use:
byte[] filenameBytes = System.Text.Encoding.Default.GetBytes(filename + ‘\0′);
rather then:
byte[] filenameBytes = System.Text.Encoding.Default.GetBytes(filename+null);
Also note that objects in C# seem to be casesensitive so “filenameBytes” is different from ”
“filenamebytes”.A tutorial on audio playback using C# with a FMOD wrapper class can be found here:
http://www.fmod.org/forum/viewtopic.php?t=4874&highlight=visual+studio+2005
So that’s one thing down….now to implement the rest of the program.
In summary, what I learned today:
- A bit on Microsoft SQL 2005 Mobile.
- How to get FMOD APIs to work with WM5 in Visual Studio 2005.
- A bit on the .NET CF, that it is a subset of the full .NET framework (around 1.5 MB vs 30MB respectively) and that certain controls such as RichText is not available.
- A possible workaround to the use of RichText is a standard HTML file as there is a “WebBrowser” control in .NET CF.