将VS2005项目移植到VS2015项目,获取虚假&& “定义的类别太多”例外 [英] Porting VS2005 project to VS2015 Project, Getting false && "Too many categories defined" Exception

查看:521
本文介绍了将VS2005项目移植到VS2015项目,获取虚假&& “定义的类别太多”例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已将所有公司项目从VS2005移植到VS2015 IDE。之后我开始运行我的应用程序,我得到如下的例外, 



我找出导致此异常的源文件,


n atltrace.h文件在给定路径中" C:\Program Files(x86)\ Microsoft Visual Studio 14.0\VC\atlmfc\include\atltrace.h"



在RegisterCategory()中功能,在以下代码中:


if(m_nLastCategory> = MaxCategoryArray) 

{

ATLASSERT(假和&&"太多类别定义");

return;

}



m_nLastCategory达到MaxCategoryArray值32.因此得到了以上异常。



但我不知道为什么m_nLastCategory达到了32.请帮助解决这个问题。



T. hanks,


Bharathraj







Bharathraj

解决方案

嗨Bharathraj,


感谢您在此发帖。


>> 将VS2005项目移植到VS2015 Project,获取false&& "定义的类别太多"例外


对于这种情况,我建议您尝试以下步骤。


  1. 右键单击您的cpp文件,然后选择"属性"
  2. 打开"C / C ++>预编译标题":选择 "使用 (/ Yu)"

如果这些仍然无效,我建议你创建一个新的空项目并复制你的源文件到它。然后重建它,看看是否有效。


希望这可以帮助你。


最好的问候,

Sera Yu




Hi,

I have ported all my company projects from VS2005 to VS2015 IDE. After that i started to run my application, i got an exception like below, 

I figured out the source file which causes this exception,

n atltrace.h file in given path "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\atltrace.h"

In RegisterCategory() function, In below code

if (m_nLastCategory >= MaxCategoryArray) 
{
ATLASSERT(false && "Too many categories defined");
return;
}

m_nLastCategory reaches MaxCategoryArray value 32. so got above exception.

But i have no idea why the m_nLastCategory reaches 32. Kindly some one help on this to resolve the problem.

Thanks,

Bharathraj



Bharathraj

解决方案

Hi Bharathraj,

thanks for posting here.

>>Porting VS2005 project to VS2015 Project, Getting false && "Too many categories defined" Exception

For this case, I suggest you try these steps below.

  1. Right-click your cpp files and select "Properties"
  2. Open "C/C++ > Precompiled Header": select "Use (/Yu)"

If these still couldn't work, I suggest you create a new empty project and copy your source files into it. Then rebuild it and see if this works.

Hope this could be help of you.

Best Regards,
Sera Yu


这篇关于将VS2005项目移植到VS2015项目,获取虚假&& “定义的类别太多”例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆