如果使用“0”,则未发现弃用的函数;系统::线程::线程状态“;(和其他人!)C++;VS2005/2008 我在VS2005和VS2008上用C++面对一个问题… 下面是你如何重现这个问题的

如果使用“0”,则未发现弃用的函数;系统::线程::线程状态“;(和其他人!)C++;VS2005/2008 我在VS2005和VS2008上用C++面对一个问题… 下面是你如何重现这个问题的,c++,visual-studio-2008,visual-studio-2005,compiler-construction,deprecated,C++,Visual Studio 2008,Visual Studio 2005,Compiler Construction,Deprecated,创建一个名为“test”的新(c++)项目(file | new | project) 选择“Windows窗体应用程序” 并将“stdio.h”include和下面的代码片段添加到test.cpp源文件中。。。。。 -------------------代码段的开头-------------------- #include <stdio.h> ... int main(array<System::String ^> ^args) { int i;

创建一个名为“test”的新(c++)项目(file | new | project) 选择“Windows窗体应用程序”

并将“stdio.h”include和下面的代码片段添加到test.cpp源文件中。。。。。 -------------------代码段的开头--------------------

#include <stdio.h>

 ...

int main(array<System::String ^> ^args)
{
    int i;
    System::Threading::ThreadState state;

    char str[20];
    sprintf (str, "%s", "test string");

...
#包括
...
int main(数组^args)
{
int i;
系统::线程::线程状态;
char-str[20];
sprintf(str、“%s”、“测试字符串”);
...
-------------------片段结尾--------------------

#include <stdio.h>

 ...

int main(array<System::String ^> ^args)
{
    int i;
    System::Threading::ThreadState state;

    char str[20];
    sprintf (str, "%s", "test string");

...
如果您按照上面的方式编译代码(您必须先“buildall”),您将收到两条关于“i”和“state”未被引用的警告(与sprintf被弃用无关)

如果您注释掉“System::Threading:Thread state;”,您将得到一条关于“i”未被引用的警告和另一条关于“弃用”sprintf语句的警告(C4996)

“System::Windows::Forms::MessageBoxIcon”、“System::Base64FormattingOptions”(可能所有“enum类”类型都会出现此问题!)

任何人都知道此处演示的问题的原因和解决方法(我有其他文件演示此问题…)(我在msdn上启动了一个线程,但后来发现了此站点!请参阅下面的链接)


这听起来像是您应该向Microsoft技术支持部门提出的问题