当VS2008中生成一个WTL项目时,增加ATL控件或者ojbect,会报错。 搜索了一下,需要修改C:/Program Files/Microsoft Visual Studio 9/VC/VCWizards/1033/common.js文件。 原始行: if (strTypeString == "ATL::CComModule" || strTypeString == "ATL::CAutoThreadModule" ) 修改成: if (strTypeString == "ATL::CComModule" || strTypeString == "ATL::CAutoThreadModule" || strTypeString == "WTL::CAppModule" || strTypeString == "WTL::CServerAppModule") 然后,编译项目,就使用向导可以添加了。 参见: http://forums.msdn.microsoft.com/en/vcgeneral/thread/7d9a0bb3-fa2a-416b-8982-aa0fbacb5b45/