+1  A: 

So, I figured this out. Lutz's HTML Writer doesn't behave well when it is executed in 64-bit mode. I imagine you are targeting "Any CPU" when you compile, as I was. Some of the Windows API calls made by Writer failed to work as expected when called from 64-bit code. This is due to the change in pointer sizes, which Lutz apparently did not guard against. Compiling to target x86-only may be an acceptable solution for you. If not, you can change the first struct member in the STATSTG struct in NativeMethods.cs from:

[MarshalAs(UnmanagedType.I4)]
public int pwcsName;

To the more correct:

[MarshalAs(UnmanagedType.LPTStr)]
public string pwcsName;

And the problem with SaveHtml() should be fixed. I came across some other bugs in the Writer.exe application in x64 mode, so be aware that you might have to go track down other pInvoke-related bugs if you must support x64.

PeterAllenWebb
Wow I just downloaded again from Lutz's site and it appears to have been corrected just hours after your post. Not sure how many other 64-bit related issues may have been addressed but at least this one's resolved. Thanks Lutz!
msulis
and thanks Peter for your work on this!
msulis