Thanks Timo
I'm running Windows 10 64 bit, where there is no vfw32.dll. It has been replaced by msvfw32.dll so I had to change
#pragma comment(lib, "vfw32.lib")
to
#pragma comment(lib, "msvfw32.lib")
I'm not sure, but I think that frankie's SDK must be installed to use the msvfw32.dlls.