# Monday, December 15, 2003

After reading Neil Cowburn's resolutions, I feel compelled to lay out my own:

  1. I will learn better how hardware and data buses work by learning PIC programming
  2. I will finish my Pocket Excel wrapper
  3. I will resist the temptation to always start new projects when I have unfinished ones on my plate
  4. I will overcome my loathing for web programming and try out ASP.NET
  5. I will get off my lazy ass and learn how the DataSet class works

Of course I should add to that the fact that I need to place more effort into some project that provide me financial benefit, otherwise my wife is going to get a bit fed-up with me burning so much personal time.  Anyone need any small project help or side work done?  :)

Monday, December 15, 2003 12:09:41 PM (Central Standard Time, UTC-06:00)  #     | 
# Thursday, December 04, 2003

So yesterday on my commute home I was thinking (it's an hour each way, so there's lots of time for it). 

Many developers have asked about getting the name of a control in the CF, and it's just not nicely exposed.  I thought, wouldn't it be nice to be able to get the name of a control if I have an instance of it (like in an event handler) or to be able to get an instance of a control if I know the string name? 

With a little work using reflection I came up with this (and for the record, reflection f'ing rocks!), which will be in the SDF release:

public class ControlEx
{
	public static Control GetControlByName(Control Parent, string Name)
	{
		FieldInfo info = Parent.GetType().GetField(Name,
			BindingFlags.NonPublic | BindingFlags.Instance |
			BindingFlags.Public | BindingFlags.IgnoreCase);

		if(info == null) return null;

		object o = info.GetValue(Parent);

		if(o == null) return null;

		return (Control)o;
	}

	public static string GetControlName(object SourceControl)
	{
		FieldInfo[] fi = ((Control)SourceControl).Parent.GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance |
			BindingFlags.Public | BindingFlags.IgnoreCase);

		foreach(FieldInfo f in fi)
		{
			if(f.GetValue(((Control)SourceControl).Parent).Equals(SourceControl))
				return f.Name;
		}

		return null;
	}
}
Thursday, December 04, 2003 11:16:34 AM (Central Standard Time, UTC-06:00)  #     | 

OpenNETCF now has over 21,000 downloads of source and binaries.  The most popular being the WinAPI and the Desktop Communications libraries. 

With so many downloads there have got to be some commercial apps out there using them.  Anyone know of any?  I'd love to see some of our work in action!

Thursday, December 04, 2003 11:09:15 AM (Central Standard Time, UTC-06:00)  #     | 

PocketPCDN has posted a pretty nice interview of Neil and I http://www.pocketpcdn.com/articles/interview4.html.

Thursday, December 04, 2003 11:03:50 AM (Central Standard Time, UTC-06:00)  #     |