Friday, March 10, 2006

The majority of the time I spend in front of computers is at work where a proxy has been set up. I don't have a problem with proxies, but it does really annoy me when I try out applications that have very limited support for them. It doesn't help any that the configuration for the proxy at work is through a configuration script (in Internet Explorer, see Tools -> Internet Options -> Connections -> LAN settings -> Use automatic configuration script).

In using configuration scripts, we avoid having to hardcode proxy addresses, ports, userids and passwords. Instead, we are just prompted for our userid and password every time we start up a program that connects to the internet (annoying on its own)... so long as that program supports configuration scripts. The only Internet-capable applications I currently use that support these scripts (as far as I know) are Internet Explorer and Firefox. Period. Take RSS Bandit, which I use every day. I've got a hard-coded proxy address, port, userid and password in there just so that it will work. Every time I change my network password, I have to go in there and change it there as well. Annoying. The second example is PostXING. I've really, really been looking forward to the new release of this application. I never was able to get the prior version to work with proxies. Well, yesterday the beta of the new release was released... and I can't get it to work through proxies. I've used PostXING at home many times and I really like it, but I just can't use it at work... where I spend most of my time.

Now, I have no idea what it takes to program support for proxies and configuration scripts. For all I know, configuration scripts may not even be used mainstream, even in corporate environments. Maybe I should research that. Anyway, my short rant has gotten longer than I intended.

NOTE: Don't take my comments as negative towards RSS Bandit or PostXING. I highly recommend them. I just wish they supported my corporate setup a little better :-)

posted on Friday, March 10, 2006 7:23:43 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 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]