L
Lonewolf
hi,
I'm still in the process of transiting from MFC/VC6 to vs2005, and a
lot of things are very alien to me. So hope you could bear with me if my
question sounds stupid. Basically I have native codes written in VC6
which I want to encapsulate in a managed assembly using C++/CLI so that
I can use it in C# easily without all the interop codes. So, my question
is, what is the replacement for MFC's TRACE macro in VS2005's C++/CLI
in native(unmanaged) codes?
I tried to see what's inside a WCHAR buffer declared as
WCHAR Buffer[256];
in MFC, it's as simple as
TRACE1("\n Buffer=%s", Buffer);
I tried using
Debug::Write("\n Buffer="+Buffer);
which failed spectacularly.
I also tried
String^ s;
s->format("\n Buffer=%s", Buffer);
Debug::Write(s);
which the IDE complained as parameter 2 of String::format is not Object,
which obviously is not since this is in native code. I also tried
ATLTRACE2(atlGeneral, 4, "\n Buffer=%s", Buffer);
but I was unable to see anything in the IDE's output window.,
when I used win32's OutputDebugString directly, coupled with wcsprintf,
I was able to achieve something like the TRACE macro. However, I would
expect VS2005 to free me from this hassle. So, could someone please
enlighten me on this? thank yoy very much.
I'm still in the process of transiting from MFC/VC6 to vs2005, and a
lot of things are very alien to me. So hope you could bear with me if my
question sounds stupid. Basically I have native codes written in VC6
which I want to encapsulate in a managed assembly using C++/CLI so that
I can use it in C# easily without all the interop codes. So, my question
is, what is the replacement for MFC's TRACE macro in VS2005's C++/CLI
in native(unmanaged) codes?
I tried to see what's inside a WCHAR buffer declared as
WCHAR Buffer[256];
in MFC, it's as simple as
TRACE1("\n Buffer=%s", Buffer);
I tried using
Debug::Write("\n Buffer="+Buffer);
which failed spectacularly.
I also tried
String^ s;
s->format("\n Buffer=%s", Buffer);
Debug::Write(s);
which the IDE complained as parameter 2 of String::format is not Object,
which obviously is not since this is in native code. I also tried
ATLTRACE2(atlGeneral, 4, "\n Buffer=%s", Buffer);
but I was unable to see anything in the IDE's output window.,
when I used win32's OutputDebugString directly, coupled with wcsprintf,
I was able to achieve something like the TRACE macro. However, I would
expect VS2005 to free me from this hassle. So, could someone please
enlighten me on this? thank yoy very much.