Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

afxDump does anything

Status
Not open for further replies.

hankgao0703

Programmer
Jul 18, 2001
27
0
0
CA
When I try to use MFC predefined variable afxDump which is of type CDumpContext, I can not get anything from it, but it supposes to dump output to default debugger, which in VC6.0 environment is the debug window.

Does anybody know the reason?

Thanks
Hank Gao
 
post a sample of your code that does not work. If you get any complile or runtime errors post the error message as well. This should work if _DEBUG is defined:

Code:
afxDump << &quot;This is a test\n&quot;;

-pete
 
Thanks for reply.

I just want to test afxDump, so I created a console project with MFC support, in my main function, I just put the following line:
afxDump << &quot;Messages&quot;;
and I can not find the anything in the debug window.

The project was built with Win32 Debug configuration, so _DEBUg should be defined.

By the way, I also tried the following code:
....
CFile fhDump;
fhDump.Open(&quot;c:/dump.txt&quot;,CFile::modeCreate|CFile::modeWrite);
CDumpContext dc(&fhDump);
dc << &quot;What are you doing?\n&quot;;
dc.Flush();
fhDump.Close();
...

After executing the above code, I opened the dump.txt file, and I found nothing in it.
 
Gao,

I have no idea why afxDump << &quot;Testing\n&quot;; does not work for you I have a MFC console application and in my &quot;main&quot; function it works just as it is supposed to. I can't think of anything else i could suggest to you.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top