Update to PreviewHandlerAssociationEditor for Vista x64

John Robbins emailed me tonight to let me know that he found a bug with my PreviewHandlerAssociatedEditor tool with Vista running on x64. 

The tool first looks in the registry to see what handlers are available, and then it looks at all classes/extensions to see which have handlers registered with them.  I made the (faulty) assumption when I threw the tool together that for a class to have a mapping to a handler, that handler had to exist in the list in the registry; this assumption never failed me while I was testing on my x86 installation of Vista, but apparently on his x64 installation, John saw this happening, and as a result the app was crashing.  Of course, I should have coded it to check for this condition in the first place, since even if this condition shouldn't have occurred, it's certainly possible the registry could have been manipulated incorrectly. Regardless, I've posted a new version with the fix. For those keeping track, the fix is to change the line that looks like this:
    if (id != null) info.Handler = handlerMapping[id];
to this:
    PreviewHandlerInfo mappedHandler;
    if (id != null && handlerMapping.TryGetValue(id, out mappedHandler)) info.Handler = mappedHandler;

Comments (3)
  1. barb smalley says:

    all updates would be appreciated thanks

  2. dkat says:

    break my heart why don't you.  I thought WONDERFUL!  I Found it!  and then

    Server Error in '/' Application.


    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /code/PreviewHandlerEditor.zip

    I do thank you though for the work and thoughtfulness.  Hope it is up and available soon.

  3. d kat says:

    darn – missed that this is for Vista.  I need it for Windows 7 64 bit.  

Comments are closed.

Skip to main content