I'm trying to build LibTIFF with VC++ (using the supplied vcproj file). The library builds okay but hangs (on Windows 7) whenever I try to read any TIFF image file. I've discovered that the file gets opened using fopen(). But instead of passing te returned FILE* to fread(), a convoluted sequence occurs whereby the FILE* gets passed to _fileno() whose return value is then passed to the Windows function ReadFile(). ReadFile() hangs every time.

Is it safe to be doing this? I've always tended to avoid mixing and matching DOS file functions with Windows file functions.