It seems simple enough, does anyone else have this problem? You could try it in 10 minutes.
My OS is XP SP3 VS2010 10.0.30319.1 RTMRel
Steps: File->New Project MFC Application named Dummy OK Next Dialog Based, Static. Next Next Uncheck ActiveX controls, Uncheck Support Restart manager, Next Finish Build->Rebuild
But it doesn't build.Where do I look? Output: ------ Rebuild All started: Project: Dummy, Configuration: Debug Win32 ------ stdafx.cpp c:\program files\microsoft sdks\windows\v7.0a\include\ktmw32.h(192): error C2061: syntax error : identifier 'PTRANSACTION_NOTIFICATION' c:\program files\microsoft sdks\windows\v7.0a\include\ktmw32.h(202): error C2061: syntax error : identifier 'PTRANSACTION_NOTIFICATION' c:\program files\microsoft sdks\windows\v7.0a\include\ktmw32.h(222): error C2061: syntax error : identifier 'NOTIFICATION_MASK' c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atltransactionmanager.h(202): error C2146: syntax error : missing ';' before identifier 'RegCreateKeyExW' c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atltransactionmanager.h(202): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...
...
...
... ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
解决办法:
I followed the link, it suggested that the problem was with some settings imported from VS2005, and that I could get the default behavior by deleting C:\Documents and Settings\~username~\Local Settings\Application Data\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props
I renamed it, and I was able to create a new MFC project that actually compiled.
引用:http://social.msdn.microsoft.com/Forums/zh-CN/vcmfcatl/thread/d2fbe7ad-58e0-46f0-b5db-9e8d430eac05