Somehow an ESCRIPT_DLL_API had crept into the header file, and to compound matters, the definition in the cpp file had no call method specifier at all. Windows hates people doing that.