Thursday, October 29, 2009

More Vista misery

Did I mention this before ? I have reinstalled Vista using the CDs that came with the computer. It's as fresh as it gets. The control panel does not work, it appears then disappears. I can run the control panel items if I know their names, but the control panel itself is simply gone.

Windows search is useless

So, one of the worst things about vista is the new search in folders, which doesn't return any matches even when you know they exist. I'm not sure what the logic is there. We recently had a bug report where one video in our app would not play with the WMP control, and the WMP control default view was changed. I fixed the latter issue, but still cannot repro the former on XP. In my attempts to do so, I ran every Windows update available ( I usually never run them because they have broken my PC more often than any malware ever has ). So, today I right click on a folder and choose search and a new dialog appears. I vaugely recall 'windows search' being on that upgrade list....

The new dialog tells me I cannot search the folder I want to as it is 'not indexed'. Funny, I used to be able to just search my hard drive. And there's no UI to help you, you have to go and read the help, then open a dialog, then work out how to add the folder you want to search to the index. Nice one, that makes like SO much better. Well worth the update.

Having indexed my source code folder ( which happens instantly, it seems and therefore seems like something that I could have been asked instead of being told I just plain can't search my own file system ), I now find that the search cannot find the files I want. I KNOW there's some files there that match my search, I just can't see the one I want. A bit more digging and I find out that the actual UI is just a mess. There's a text box, whose purpose I am not sure of, but if I type my term in there, it searches and tells me there were no matches. Maybe it searches the desktop and the UI under searches where I wanted to search ? Either way, yet another piece of totally useless UI and an update that makes things worse, not better.

Stop the presses. There's a button at the bottom called 'search companion'. The 'companion' is the old search, the one that actually works. So if you've accidentally installed this mess, just push that and you'll get a working search again.

Wednesday, October 28, 2009

SQL Server crash

I just started SQL Server, connected to my SQL Server Compact DB, and got a null reference error. My SQL Server 2008 is now showing me the connection dialog, but there are no options in it. Here's the error that I was shown:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SqlServer.Management.UI.ConnectionDlg.LoginControl.UpdateInstanceLabel()
at Microsoft.SqlServer.Management.UI.ConnectionDlg.LoginControl.Sync(UIConnectionInfo ci)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.ConnectionDialog.DoOneTimeInitialization()
at Microsoft.SqlServer.Management.UI.ConnectionDlg.ConnectionDialog.OnVisibleChanged(EventArgs e)
at Microsoft.SqlServer.Management.UI.VSIntegration.ShellConnectionDialog.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

How is this remotely possible ? It sure isn't acceptable. Here is the dialog box:

On top of this, my SQL Server 2005 ( my default instance ) just up and died a week or so ago. I've spent far too long on google, and I can't work out how to make it work, if I start the service, it just stops. I've googled the errors in the logs, but I've had no luck. I've basically given up on it at this point, if I need any of the data, I assume I can import it in to SS2008 from the files on my file system still...

Monday, October 26, 2009

Burning CDs or, why can't it just remember my preference ?

I am burning some installer DVDs using Vista. I put in a DVD, and it prompts me how I want to use the disc. I choose to burn with the file system. EVERY TIME I do this, it selects to do it using a format that lets me add files as I go, despite my EVERY TIME selecting to do a 'master' burn so it's more likely to work on other machines. And of course, it HIDES the options, which is why I forget from time to time that they exist. I have to expand the list and select the same option EVERY time, or I lose a disc and some time.

I've lost several discs to forgetting this little wrinkle. Why can't it just remember that I have NEVER willingly burned a DVD this way, I've only ever done it accidentally, pressed cancel, found that cancel does nothing, and waited to throw the disc out ? It's bad enough that search in Vista is fundamentally useless, that UAC makes the machine unusable ( and I can't turn it off b/c I need to use it to test for our vanilla users ), and so on, but surely Microsoft, who make their living on average products that copy other ideas but improve the UI, can make a UI that remembers how I like to burn DVDs ?

Sunday, October 25, 2009


This is just a little thing, and it's something that has since been fixed, but it kind of illustrates the lack of communication or thought between different parts of Microsoft teams. When I became an MVP, I was almost immediately whisked to a Microsoft summit. I believe VS2005 was in development at the time. During the summit, the person in charge of the VS IDE gave a presentation. I asked her at the time why it is that visual studio will create stub methods on a right click, so I can do


then right click and create a stub to then navigate to, to add this method, and the default method would throw a generic exception. The point being that a 'NotYetImplimentedException' existed in the framework and is what should be thrown here. She 'took a note'. However, this was not rectified in 2005 ( although I did get sent a nice paperweight that says 'thanks for helping us improve Visual Studio 2005', the fact is that not one bug I reported was corrected ). I believe it was fixed in VS2008, but the point is not so much that they didn't immediately make a tiny change to a product in development to make it act in a sane manner, it's the fact that they didn't do what I was suggesting in the first place. Like the issue with Visual Studio not working in Vista without setting it up to run as admin, or any number of other issues we all encounter, the problem is that the teams at Microsoft don't seem to talk to one another, don't seem to care about using the framework as a whole consistently, and don't seem to care about how their product will work in relation to the rest of the Microsoft product base.

Friday, October 23, 2009

Default behaviour/WMP control

When I was an MVP, one of the first things I did was ask the C# team for default values on variables, like C++ has, and VB.NET has. They would get tied in knots over how complex it would be. We are finally getting this feature. In the meantime, if I had a method and I wanted to extend it, I'd do something like this:

old method :

bool DoSomething(string name, int age)

new methods:

bool DoSomething(string name, int age, bool doSomethingExtra)

bool DoSomething(string name, int age)
return DoSomething(name, age, false);

In other words, you need to keep your default behaviour for existing clients of the code, and then allow changes of the code for any client who wants to use the new functionality. In any situation, if you want to extend something that exists, you need to make sure you don't break it for people already using it, right ?

Our WPF application uses the Windows Media Player control, I've already explained why in the past. We just wrapped up our installer for our new version and shipped it. Shortly after release, we started to get reports from people that the player in our app was showing the WMP controls. It turns out the person who wrote that code, never added code to set the uiMode. I have searched and can't find any way to set the default value for that, but I have had it happen on one machine, further confirming that a windows update has changed windows media player so that if you don't set a uiMode, the default is no longer none. This is major for us because it also means the control catches right clicks, which we use when we put the control in full screen mode.

On top of that, a video which plays fine on all of my test machines, some of which are completely virgin, is reporting that 'Windows Media Player cannot open files of type wmv'. Now, all our videos are WMVs, but either way, WMP can't play WMVs ? Again, it's clear by the fact this is happening on computers where before everything was fine, that a windows update has basically changed how the windows media player control behaves, and broken our app. I am shipping an update that sets the uiMode, and we should have done that in the first place, but either way, if you do an update, you should make sure you're not going to break existing clients. That's just common sense.

Update: I installed IE8 ( I actually asked it to install 5 times, it would not install until I selected to participate in the customer experience improvement program ), and now I can reproduce the UI issue. The video in question still plays fine, but it looks to me like IE8 is the cause of the other issue. I need still to install XP SP3, I've avoided that since it completely trashed one of my AMD based machines, I'll install that next ( my Mac is Intel based ), and see if that creates the issue with the file not playing.

(update) I have updated my Vista machine to the hilt ( 100+ updates, took an evening and a morning to do ), and I can't repro the issue with the file not playing, so I assume that was actually an issue with a single install, and not a Microsoft issue at all. As I updated my Vista machine, I once again saw our UI change from no UI over WMP to the full UI, as reported above. I am just rolling out the patch now to fix this issue for our users.