Windows API functions usually have two versions. There is a "W" version when building for UNICODE and an "A" version for non-UNICODE builds. For example, when building for UNICODE the compiler sees a function named ExtTextOutW which expects wide-character strings. However, the example code declares some variables as LPSTR which means it is a pointer to a narrow string. This causes the compiler errors.
The simplest solution is to change the character set that you are building for to either "Not Set" or MBCS. That should eliminate the kinds of errors you have described.