在vc中可以使用trace宏打印调试信息
在netframe中就不行了。
可以使用Debug类进行输出调试信息
e.g:
Debug::Listeners->Add( gcnew TextWriterTraceListener( Console::Out ) );
Debug::AutoFlush = true;
Debug::Indent();
Debug::WriteLine( "Entering Main" );
//to find by convert
String^ strTest = gcnew String("123");
int ikkk = 890;
strTest = Convert::ToString(ikkk);
String^ strMessage =gcnew String("");
strMessage =String::Format("int32 to STring {0}->{1}",ikkk,strTest);
Debug::WriteLine(strMessage);
int i = Convert::ToInt32(strTest);
strMessage =String::Format("String to int32 {0}->{1}",ikkk,strTest);
Debug::WriteLine(strMessage);
Debug::WriteLine( "Exiting Main" );
Debug::Unindent();
注意要使用命名空间
using namespace System;
using namespace System::Diagnostics;
具体函数内容可以下载WINCV.EXE进行查看