When you are using the MFC wizard to create a new project, on the "Advanced features" page it says "Common Control Manifest". That needs to be enabled for themes to work.

Are you using UNICODE or not? Check this in project settings > General > Character set.