Did you download the DirectX 8 SDK?

For the first one, you need to change the linker options to use WinMain as the entry point.