Thursday, March 09, 2006

Words can't describe this. You've got to see it for yourself.

(Can you imagine programming at 10240x3072?)

(via Digg)

posted on Thursday, March 09, 2006 7:25:13 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Wednesday, March 08, 2006

Live.com received a makeover recently, and their search engine has been revamped. I've played around with Live.com before, but never really used it. The changes they've made are definitely an improvement, but after adding a few of my own feeds to it, I'm still seeing some unexpected behavior such as sections overlapping each other. I'm using the IE7 beta 2 preview.

The search engine has some pretty nice features, like smart scrolling, which allows you to scroll all of the results instead of having to go between pages. It is interesting at the very least. A cool idea is the ability to search within pages directly from the search results page. It is worth having a look. I did run into a few issues with it such as getting some permission denied JavaScript errors after a couple of searches.

I would consider using it more after some of the edges are cleaned up.

UPDATE: I tried the search feature again... it is really pretty cool. I haven't used it enough to get a feel for how accurate the search results are, but I really do like the way it handles scrolling. We'll see how continued usage goes.

posted on Wednesday, March 08, 2006 12:46:12 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

I've blogged about the FlowLayoutPanel in the past. It is a highly useful control in certain circumstances, but it doesn't behave as expected a lot of the time. In trying to better explain how it works, I created a small test program to show what it is doing. Here is what it looks like:

It primarily demonstrates how FlowDirection and WrapContents affect controls in the FlowLayoutPanel, particularly dynamically added controls. If you click one of the dynamically added buttons, it will pull up that buttons PropertyGrid, which will allow you to edit its properties. This is useful to examine the effects of sizing, anchoring, and docking.

Here's the link to the VS2005 solution if you're interested in playing around with it. It's in C#. I wanted to play around with anonymous delegates :-)

posted on Wednesday, March 08, 2006 8:33:27 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Monday, March 06, 2006
This may not be new for everyone, but I just learned it today. In webpages, to set focus to a control after a page has loaded, you handle the body's onload event and then call the focus method off of the control.

In .NET, there is a focus method off of controls, but it doesn't work if the control isn't visible... i.e. in the constructor or in the Load event. To get around this, use the ActiveControl property off of the Form or UserControl, like so:

  105 Me.ActiveControl = Me.txtTo

Not too bad, eh? In this example, Me.txtTo will have focus when the Form or UserControl is displayed. Just make sure it is in the Load event. It didn't seem to work for me in the constructor (even after the InitializeComponent call). Of course, I only tried it once...

(Google'd and found via here)
posted on Monday, March 06, 2006 4:49:13 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

Lately, I've been doing some work with integrating some of my managed applications with Outlook. There are a lot of code examples and articles out there on using the Outlook COM interop library for tying into Outlook, but be prepared for a lot of security prompts for the user. I understand the reasoning behind those security prompts, but man are they annoying.

You basically have two options at this point if you don't like the prompts. Extended MAPI or Outlook Redemption. Seriously, those seem to be the only two options available, unless your application is actually an add-in using VSTO. Extended MAPI is essentially the low-level side of Outlook. To program against it, you're looking at using C/C++ or Delphi, because your only interface is header files. I took a look at it and it is HAIRY. If you are interested in that option, though, check out MAPIEx at the Code Project. It has some great examples of using Extended MAPI and also showed me enough to scare me away from this option. I would love to spend my company's time and resources learning this and code in C++, but I don't think they would appreciate that very much.

Okay, next. Outlook Redemption. It is a COM wrapper around the Extended MAPI interface that works great. Dmitry Streblechenko created a lot of safe objects around their Extended MAPI counterparts. You code against the Outlook Interop library (add a COM reference to "Microsoft Outlook 11.0 Object Library") and tie that in with Redemption. Everyone uses this thing. Just about every newsgroup post, website, etc. that mentions tying into Outlook recommends this library. I guess this is another recommendation.

My only real complaint with Redemption had to be the stupid Fields collection off of just about every Redemption object. For example, let's look at the Redemption.AddressEntry. It exposes a name, address, and a few other handy properties, but that is about it. If you want to get anything else, you have to use the Fields collection, which takes an Integer and returns an Object. The Fields collection could be compared to a Dictionary object in the .NET Framework. The name is a unique integer that is a lookup to a value. A little annoying but hey, if we have constants, who cares right? Right??? ... What do you mean we don't have any constants? Ohhh, we have to find those out for ourself or buy Outlook Spy! I hate magic numbers!

I was fairly confident that the lookup constants were defined somewhere so I began hunting them down and discovered the MAPITags.h file (mine was at C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include). All of the constants use a macro called PROP_TAGS (see MAPIDefS.h) that takes a ULong propID and a ULong propType. Internally, Outlook uses a multitude of different property types like PT_NULL, PT_LONG, PT_BOOLEAN, etc. The PROP_TAG macro takes the type and a unique lookup. That's why the Fields dictionary returns an Object: it might be a long or a boolean or a string or an internal Outlook structure. I ended up writing a console application that read in a header file and spit out a list of VB constants. The regular expression I used was "\#define\s+?(?<name>[\w|\d]+?)\s+PROP_TAG\(\s?(?<type>[\w\d]+?),\s?(?<id>[\w\d]+?)\)".

Anyway, long story short, I'm working with Outlook now and it is really cool. I'm able to, based on a name and my generated VB constants, lookup a property of a contact in my address book. Another programmer and I have been spamming each other testing with meeting appointments and emails ever since. Fun, eh?

posted on Monday, March 06, 2006 8:08:35 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Saturday, March 04, 2006

I recently moved my feeds over to FeedBurner, so if you're subscribed to my feed, please point over to my new FeedBurner address at http://feeds.feedburner.com/DavidMohundro.

Also, thanks to Darren Neimke for moving his feed over in the first place. I hadn't considered looking at FeedBurner until he mentioned it for his blog.

posted on Saturday, March 04, 2006 3:11:51 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Thursday, March 02, 2006
Thanks to a post from Jeff Atwood, I discovered the blog of Francesco Belana. He's the author of some great books including Programming Visual Basic.NET, which my company has been using to get our developers up to speed on .NET.

I'd like to point out a couple of posts of his that give great examples of using generics in .NET 2.0.

Check them out:
posted on Thursday, March 02, 2006 8:04:15 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Wednesday, March 01, 2006
Check out Open Web Design.

They've got some web templates out there that look great. And they're open source, too! Looks like the perfect tool for people who want their websites to look cool, but don't have an eye for it.

(via Digg)
posted on Wednesday, March 01, 2006 1:02:59 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
Roy Osherove posts today about different ways to accomplish thread-safe GUIs using .NET 2.0... and C#.

Since we're primarily using VB.NET at work, we don't get the anonymous delegate love... oh well. Ever since I discovered that JavaScript could do the same thing*, I've been wanting to use it in managed code as well. I guess I'll have to do it on my own time for now.

* like so:  document.body.onload = function () { alert("I've been loaded!") }
posted on Wednesday, March 01, 2006 7:46:28 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Monday, February 27, 2006

What would happen if Microsoft had branded the iPod instead of Apple?

Something like this...

According to Mary Jo Foley from Microsoft Watch, the video was produced by Microsoft, which makes it even funnier!

Check it out!

UPDATE: Corrected URL to point to Google Video.

posted on Monday, February 27, 2006 5:33:17 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Friday, February 24, 2006
Larry O'Brien talks about the myth of better programming languages and how "there is not a shared psychology of computer programming." Seriously, it really does have to do with how you think about things. I work with people who can type all day and then compile and run their program without any errors... in COBOL. Does that mean that it is a better programming language? Maybe for them. Most definitely not for me.

As a side note, Kona and the Big Island of Hawaii rule.

(found via the Daily Grind)
posted on Friday, February 24, 2006 7:46:19 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
If you've never seen some of the posts from Kevin Moore regarding WPF (commonly pronounced Avalon), you should definitely check them out. In particular, some of the things you can do with ListViews and XAML are incredible! He points to this post to show some of the XAML that is required and, really, it doesn't look that bad. To get something like that out of the built-in ListView in .NET 1.1 or .NET 2.0, you would have to do some owner-drawn madness... or do the entire thing yourself.

I don't know about you, but I'm looking forward to WPF!
posted on Friday, February 24, 2006 7:26:44 AM (Central Standard Time, UTC-06:00)  #    Comments [0]