當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/