Monday, December 03, 2007

VC 2008 released!

...And incremental linking is apparently broken! What great fun!

Friday, November 23, 2007

WTF

Saturday, October 13, 2007

Where does Visual Studio fail?

When you create a new Win32 project in Visual C++ 2005, you get a message loop that looks like this:
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

So what's wrong with that? Probably the fact that the MSDN documentation for GetMessage specifically says not to write code that looks like that! This is what it does say:
Warning

Because the return value can be nonzero, zero, or -1, avoid code like this:

while (GetMessage( lpMsg, hWnd, 0, 0)) ...

The possibility of a -1 return value means that such code can lead to fatal application errors. Instead, use code like this:

BOOL bRet;

while( (bRet = GetMessage( &msg, hWnd, 0, 0 )) != 0)
{
if (bRet == -1)
{
// handle the error and possibly exit
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

Perhaps it doesn't make much difference in actuality, but you would have thought they would at least make the code in their template consistent with their own documentation (which comes with Visual Studio in the MSDN library, I might add..)

Monday, September 24, 2007

Bugs, bugs, bugs

Today I decided to run the Windows Experience Index assessment again since it said it my score needed updating. However, peculiarly when I clicked "Refresh my score" there was no progress dialog shown. You could see the test was actually running, evident from Aero being temporarily disabled etc.

Luckily for me, I had an inkling as to where the progress dialog had gone. A few days earlier, I had decided to enable the option "Lauch folder windows in a separate process" in Folder Options and I suspected that was causing the problem. So I disabled that option, closed all windows then opened system properties to re-run the test. Bingo! Progress dialog was back. And just to check my findings, I enabled that option on a another computer - with the same lack of a progress dialog.

So, in summary, its probably best not to enable that option.

Saturday, September 15, 2007

Minor Vista bug

As I like to note them, I just found another minor but annoying Vista bug.

Go to Control Panel / Power Options / Edit Plan Settings. Click on one of the drop downs, press down or up on the keyboard and click on the drop down (same button area) again. Lo and behold, the Save Changes button stays disabled - so you can't apply the changes.

Probably mixed mouse and keyboard navigation like this is not so common, but I use it pretty often on my laptop + touchpad. It's funny because VS2005 has same bug in some places (e.g. project properties) - which I reported before it was released but they refused to fix at the time because it was below their bar (next release was release candidate or something). They didn't fix it in SP1 of course.

Sunday, September 09, 2007

Vista in nuts mode

The Vista on my laptop decided to go (literally) nuts a few days ago. Nuts, as in a few minutes after login it would half-freeze. Half freeze as in stop responding to keyboard and mouse, thrash the hard drive but still let some UI updates through (e.g. clock).

This would obviously make locating the cause a nightmare. I did manage to cause some funky BSODs in this mode trying to hibernate (something like INTERNAL_POWER_FAILURE ?)

Safe mode was working, but I couldn't see what I could to resolve this. Nothing interesting in the Event Log, and System Restore had no checkpoints (probably because I had it disabled when I was using XP and this install was an upgrade of that).

So I decided to format and reinstall Vista. Alls well that ends well because now Vista is far more responsive. It could be related to the recent performance/reliability updates (which caused problems on my old vista install). Or possibly the lack of junk installed that came with the laptop. What's great is that coming out of sleep mode actually happens in a reasonable time now!

Friday, August 24, 2007

Vista vs UX guidelines

One of the changes in the Vista UX guidelines is regarding capitalisation. On the subject, they say:
Use title-style capitalization for titles, sentence-style capitalization for all other UI elements. Doing so is more appropriate for the Windows Vista tone and its more descriptive use of text.
Exception: For legacy applications, you may use title-style capitalization for command buttons, menus, and column headings if necessary to avoid mixing capitalization styles.
They also have a whole article dedicated to menus, in which they say on labels:
Use sentence-style capitalization.
Exception: For legacy applications, you may use title-style capitalization if necessary to avoid mixing capitalization styles.
One does wonder how much attention Microsoft pay to these guidelines. Let's take a look at the context menu for a shortcut to a application in Windows Explorer on Vista RTM + updates.


Ignoring the entries from 3rd party software, what do we find? Mixed capitalisation styles. In sentence-style, we have "Run as administrator", "Open file location" amongst others. In title-style we have "Pin to Start Menu", "Create Shortcut" amongst others. It does looks somewhat unclean and why they left it like this can only be described as a mystery.

In the same article about menu guidelines, we see some interesting differences between what is shown there in the screenshots and what is actually in Vista:


In this screenshot, WordPad in Vista is on the left, and from the article is on the right. At least part of the UX guidelines were written after Vista was released, so perhaps these changes should be looked out for in Vista SP1.

It was also interesting to note in the same UX guidelines they point out some errors in Vista RTM. For example this appears in the article on progress meters:

Incorrect:

In this example, halting the copy leaves any copied files, so the command button should be labeled Stop.

If you've tried to cancel a file-copy operation in Vista, you'd realise this is talking about the actual behaviour in Vista.

Command Prompts on Vista

I learnt of a neat trick on Vista through another blog - if you hold down shift whilst right clicking on a folder on Vista you get an extra entry: "Open Command Window Here" (in general you get some extra entries, folder or file). Very useful - previously on XP I had to install a PowerToy (as I remember?) to get this in the context menu.

It does lead me in to a bit of a rant though. When you have UAC enabled, sometimes you need to use elevated command prompts which start in a particular directory. This was the case for myself one day, I wanted a reusable shortcut for this so I created a new shortcut to cmd.exe and changed the "Start In" directory. Opening it showed the expected behaviour - it started in the chosen folder. Now to run it as administrator (using the context menu option). Failure - it starts in "C:\Windows\system32" for some reason. Possibly because it's the location of consent.exe, I don't know, but it's not the most intuitive behaviour.

Thursday, August 23, 2007

Vista + Menus

Normally, or at least by default, menus in Windows Explorer on Vista are hidden until you press the ALT key on your keyboard. But for some reason my Vista install displays menus permanently in all Windows Explorer windows. Despite the fact I have the "Always show menus" option disabled:


It's pretty annoying so I wouldn't mind knowing how to fix it..

Tuesday, August 21, 2007

Vista Bugs Again

Is disabling the status bar by default a good reason not to test it?

Crap, I didn't know you could make files with negative size. Why did I bother buying a 750GB hard drive?

More Vista whinging soon!

Monday, August 20, 2007

Vista File Save As Dialog Gone Wrong

I click "Save As" one day in my favourite application only to be very confused:

Ahem, where do I enter the filename?? Which folder is empty?! Let's try clicking the "Browse Folders" button:

OK, now my folder is not empty but still nowhere to change folder or enter the filename.

One last try, let's click the "Hide Folders" button:
Now, this was in Mozilla Firefox. So who's to blame, Firefox or Vista? It is a standard dialog provided by Windows so it would be odd for Firefox to cause this. However it was not occurring in other applications at the time and trying again to save a file in Firefox resulted in the same mess. Even the breadcrumb/navigation bar was missing! Maybe OLE/COM initialisation related, who knows...

Monday, February 26, 2007

Winning e-mail

All I can say is hehehehehehehehehehe
Dear xxxx


Congratulations!

We're very pleased to tell you that you were one of the first 1000 people to qualify for a free copy of Windows Vista Ultimate by taking part in our UK Developer Launch event online.

We will ship the prizes to the winners as soon as we take delivery of them from our manufacturing unit. You can keep up to date with our shipment schedule via Ian Moulster's blog at http://blogs.msdn.com/ianm.
Your prize will be shipped to the following address:

xxxxx

xxxxx
xxxxx


Once again, many thanks for taking part in our Developer Launch event and we hope that you enjoy using your product.

Kind regards

The UK Developer Launch Team
I think that's the first time I've won anything :o I'll post some pictures when the actual thing arrives.

Tuesday, February 13, 2007

Netgear Draft 802.11n Notebook Adapter for £30

Fed up of my laptop's built-in wireless cutting out all the time, I was forced to use my old external adaptor which doesn't cut out but gets in a confused non-functioning state after a few hours (and doesn't support WPA2 either).

So it will be interesting to see if this Netgear WN511B card I ordered for a bargain price (just under £30 delivered) is any better. This is the same card that Maplins sell for £150 :o It has a Broadcom chipset as well which is the same as my router so hopefully I'll get good performance out of it (even though my router is only 802.11g). It seems to me like Amazon mark there prices down to try and match Marketplace sellers which I think is why they priced it so low. Its quite tempting to buy them all and sell them on eBay :P

Whilst I am talking about wireless I should mention how the Xbox 360 fails to see any wireless network in mixed mode WPA+WPA2, even though the damned thing supports (and is Wi-Fi certified for) WPA-PSK!!! Stupid Microsoft.

Update: I should point out the Xbox 360 bug was fixed since I originally made this post.

Monday, January 29, 2007

Finally 64-bit drivers for Canon CanoScan 4200F

Canon just released Vista compatible 32-bit and 64-bit drivers for my CanoScan 4200F scanner. The old 32-bit drivers didn't work on Vista (and there were no 64-bit drivers available previously). What's also good, is that the 64-bit drivers also work fine on Windows XP x64 Edition :-)

The drivers are available from the American Canon website (they aren't up on the European site at the moment).

Just what the f*** is NMIndexStoreSvr.exe for?


It eats my CPU, it eats my memory, it eats my hard drive and it evens likes to hang on the shut down of my computer.

It also quite fun playing 720p video content with this process running, as well as any games!

Now it has just decided to crash on me... what fun!

So, I check the startup entries in Spybot, and search the registry, but the stupid app is nowhere to be found in the startup entries, and yet its there every time I turn my computer on!

So I use Process Explorer to track the bugger down. It turns out its part of... Nero! Its description is "Nero Home". Strange, since I don't have Nero Home installed. So in the end I renamed the file to some expletives, and now (gasp) I can use my computer again ;-)

Saturday, January 20, 2007

Now Blu-ray "cracked"

First success of decrypting a Blu-ray disc reported :)

Friday, January 19, 2007

Microsoft giving away 1000 copies of Vista and Office 2007 (UK only)

The competition (aimed at developers) opened at 5:30pm, so in likelihood all copies are gone by now - but worth a try, no? ;) It didn't seem to have very much publicity for some reason, which is only a good thing :)

I've made my entry already and I'll let you know if I actually get anything :P

Alternatively if you are a UK student you can now get licences for the Vista Business Upgrade and Office 2007 at "reasonable" prices from the Student Select program (they for some reason don't have the actual CDs yet though!)

Friday, January 12, 2007

Using Visual Studio is fun!

I think only the Visual Studio IDE dev team could make their software do crap like the following without actually crashing.



Hmm...