Gareth Simpson's Notes

Random development notes and other whims.
  Home | Weblog | Projects | About

iTunes 4.7

Wednesday, October 27, 2004


iTunes 4.7 has been released and it has 2 minor but significant improvements:

  1. Native support for Always On Top
  2. Minimize to system tray

I’m almost sad that iTunesOnTop is obsolete, but really it should always have been there. Even a cursory look at Winamp would have told them that.


Themes and their abuse.

Sunday, October 17, 2004


Daring Fireball is picking at the Aqua v Brushed Metal scab again.

As a Mac user, I can’t say how strongly I agree with this. Safari should be Aqua, and it’s just insane that it’s not.

That said, as a Windows developer, I’m pretty envious that there are only two themes to have to try and live with. Add to that he fact that the development tools allow you to fully implement them and life in Mac-land looks even better.

‘Cause in the Windows world, life just isn’t like that. Take windows XP for example. It has a theming engine and if you write your application sensibly, you can give your application a full on XP look and feel. You can even do this with ancient tools such as VB 6 which predate XP.

So far so groovey.

Unfortuately Microsoft can’t bring itself to use it’s own themes. Every new eddition Office brings a new theme to the table that is at odds with the platform it’s running on. And it’s not just Office, tools as niche as the new versions of Visual Studio have the Office XP look.

Apart from the glaring visual inconsistency, the real problem with these custom themes is that every windows programmer out there seems to feel duty bound to ape them, despite the fact that MS doesn’t see fit to provide them with the tools to do it.

So we have a market for 3rd party custom controls that ape the latest and greatest Office, and they are almost universally rubbish.

As a developer I can either stick with the standard that is well supported in the development tools and look “out of date” or I can aquire or write some ropey Office XP-alike interface and have it not quite work right.

Genius.

Makes me wish all I had to do is flip a coin and see if comes down Aqua or Brushed Metal.

update:
Ha, I spoke too soon, things are just the same in the Mac world. I just started using DVD-Studio Pro for the first time, or I’d have known this. That said, I still wish I was a Mac developer!


Using wxWidgets in Visual C++ Express

Saturday, October 02, 2004


Microsoft did not see fit to ship Visual C++ Express with any windowing framework (MFC, ATL, WTL …). They clearly want to steer people down the .NET road.

But that doesn’t mean it can’t be done. In theory all you need is the Windows Platform SDK which is freely downloadable from MSDN. In practice, you also need a GUI framework and I’ve found that wxWidgets (né wxWindows) fits the bill perfectly.

Unfortunately it doesn’t work quite as smoothly as using the full on Visual Studio. There are a lot of linker errors to combat, but it can be done if you follow these (overly) simple instructions:

This is a revised (and much simpler) set of instructions. Thanks to Vadim Zeitlin and Gordon Klos for pointing out some flaws in the original

1. Download and install the Windows Platform SDK
Tragically you seem to need IE to do this, but never mind. It’s titled “Windows Server 2003” but it covers all the current versions of windows. You need core SDK and potentially Internet Development SDK (see point 9).

2. Download the latest version of wxWidgets and extract it to your c:\ drive
I’m using 2.5.2 – the latest bleeding edge version and you really want the windows specific version, not the full version as it inlcudes the Visual Studio project files. Using the development version is probably the cause of some of the problems. The timid could use 2.4.2 instead.

3. Open VC++ Express and get the “Options” dialog up from the “Tools” menu.

4. In the tree, open up the “Projects and Solutions” node and select “VC++ Directories”

5. Change the “Show directories…” drop list to “Include Files” and add “c:\Program Files\Microsoft SDK\include” (or wherever you installed the SDK).

6. Change to “Library Files” and add “c:\Program Files\Microsoft SDK\Lib” (or wherever).

7. Click ok to accept those changes.

8. Open up the wxWidgets Solution file in “c:\wxWidgets2.5.2\build\msw\wx.dsw” and allow Visual C++ Express to upgrade it.

9. If you could not be bothered to download the Internet SDK then in the wxWindows project open the file MSW File\app.cpp and comment out line 87 #include <shlwapi.h>

10. open c:\wxWidgets-2.5.2\src\expat\lib\winconfig.h in the editor and allow it to normalise the line endings.

11. in the regex project open the file Source Files\regerror.c.

Change the bizarre declaration:


size_t
regerror( errcode, preg, errbuf, errbuf_size)
int errcode;/* error code, or REG_ATOI or REG_ITOA */
CONST regex_t* preg;/* associated regex_t (unused at present) */
char* errbuf;/* result buffer (unless errbuf_size==0) */
size_t errbuf_size;/* available space in errbuf, can be 0 */

to the more sensible:

size_t regerror( int errcode, CONST regex_t* preg,char* errbuf, size_t errbuf_size)

12. Build the solution. Ignore the multitude of deprecated method warnings.

Having built the framework, we can now build one of the sample projects – let’s try samples/dialogs/dialogs.dsw

1. Open the workspace file, allow VC++ to upgrade the solution as normal.

2. Select the properties of the “dialogs” project.

3. In the linker/input node, add the following libraries to the “Additional Dependencies” list:

4. Hit the play button.

5. Observe with smug satisfaction as the window appears.

That’s it, for debug builds at least. I haven’t tried a release build yet. It can’t be any harder. Can it?