#if(WINVER >= 0x0500)
#pragma message ("")
#pragma message ("NOTE: WINVER has been defined as 0x0500 or greater which enables")
#pragma message ("Windows NT 5.0 and Windows 98 features. When these headers were released,")
#pragma message ("Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.")
#pragma message ("")
#pragma message ("For this release when WINVER is defined as 0x0500 or greater, you can only")
#pragma message ("build beta or test applications.  To build a retail application,")
#pragma message ("set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk")
#pragma message ("to see if retail Windows NT 5.0 or Windows 98 headers are available.")
#pragma message ("")
#pragma message ("See the SDK release notes for more information.")
#pragma message ("")
#endif

解决方案 »

  1.   

    http://www.vckbase.com/bbs/prime/viewprime.asp?id=454
      

  2.   

    转载一般情况下,#pragma message( messagestring )是在编译期间,将一个文字串(messagestring)发送到标准输出窗口。典型的使用方法是在编译时报告和显示信息。下面的代码段是编译期间在标准输出窗口显示一条消息:#if _M_IX86 == 500
    #pragma message( "Pentium processor build" )
    #endifmessagestring 参数可以将文字串常量扩展成一个宏,从而可以显示任何形式的字符串。例如,下面的语句显示被编译文件的名字以及文件被最后一次修改的日期和时间:#pragma message( "Compiling " __FILE__ ) 
    #pragma message( "Last modified on " __TIMESTAMP__ ) 
    #pragma message("Remember to write some actual code in this sample app!!"))下面我们就利用这个特性,进一步扩展#pragma message的使用。先在一个头文件(假设为lfpragma.h)中定义下面的宏:#define PTODO_LINENUMBER_TO_STRING(x) #x
    #define PTODO_LINENUMBER(x) PTODO_LINENUMBER_TO_STRING(x)
    #define INCLUDE_FILE_AND_LINE(string) __FILE__"(" PTODO_LINENUMBER(__LINE__) "): "string然后在任何cpp文件中包含lfpragma.h文件,那么我们就可以象下面这样引用前面定义的宏。如:#pragma message( INCLUDE_FILE_AND_LINE("Compiling ") __FILE__ ) 
    #pragma message( INCLUDE_FILE_AND_LINE("Last modified on ") __TIMESTAMP__ ) 
    #pragma message(INCLUDE_FILE_AND_LINE("Remember to write some actual code in this sample app!!"))这样使用#pragma message与通常使用的方法有什么不同呢?平常我们使用#pragma message时,在标准输出窗口中可以看见#pragma message的输出信息,但是鼠标点右键弹出的上下文菜单中“Go to Error/Tag”菜单项是置灰的,不可用。但是如果使用上面定义的宏,我们就可以激活上下文菜单中“Go to Error/Tag”,从而定位到相应的代码行。