Monday, October 23, 2006

DLL not found exception

I've been working on a C++ project recently that involved creating a DLL.  Although I had unit tests to pummel the objects that were used inside the DLL I wanted an easy way to test the DLL itself through its interface.  I chose to create a C# Winforms app that used the DLL using interop.

Really easy to do:

public static extern int MyFoo(string bar);

There's heaps of documentation out there for this kind of stuff.  Suffice to say that the .NET framework goes to great lengths to make this happen as easily as possible.

One gotcha that I ran into though was that initially the JIT compiler threw an exception - a DllNotFoundException.  I checked to ensure that the DLL and EXE were in the same directory, I used dumpbin to ensure that the DLL was correctly exporting the expected symbols etc...couldn't figure out what was wrong. 

Turns out that my DLL had a dependency on another DLL that wasn't in the path.  Unfortunately the exception doesn't give you any further useful information so watch out for this problem.

Friday, October 13, 2006

Two nifty Windows apps

Rearrange the items in your taskbar with Taskbar Shuffle.

Display your Outlook calendar appointments and tasks right on your desktop with DeskTask.

Tuesday, October 10, 2006

U3 USB drive

My company recently purchased a 1GB SanDisk micro cruzer USB drive for me to use.  These devices are great, providing lots of useful space.  However when you insert the drive it automatically runs some software that "assists" you with such tasks as synchronizing and password protecting your files.  Although the software may be useful to some people it isn't to me and there's no easy way to remove it [1].

Manufacturers should realise that they ought not to install - or run - a damn thing on my computer without my permission.  Ask if you must.  And if I say no don't pester me again.  Ever.  A better course of action is to ask me to opt-in; ship a CD along with the device (or provide a URL) that I can choose if I want it installed.

Anyway, after unsuccessfully trying to remove the software for a couple of minutes I hit Google and found that many other users had complained and some had found a solution.  At some stage U3 (makers of the drive) put an uninstaller online.  My PC is now clean again.

Kudos to U3 for putting the uninstaller online but, please, next time do the right thing in the first place.

[1] It fiendishly mounts two drives when you insert the device - one of which fools the operating system to appear as a read-only CD drive.  Clever, but difficult to remove.  Yes there are ways around getting it to run the software (although in this case even disabling autorun wasn't going to cut it) but I just wanted it gone.

Monday, October 02, 2006

Firefox extensions

OK, I can't find any easy way to transfer my Windows Firefox extensions and configuration to my MacBook - there are extensions to do this (notably FEBE and MozBackup) but they don't work on the Mac. 

Perhaps I can copy my profile folder?  I'll try. 

In the meantime, here are my extensions in case I have to install them one-by-one: 

ListZilla was used to easily create this list.

Are there any others that I should install?