By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,376 Members | 1,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,376 IT Pros & Developers. It's quick & easy.

Why does NativeWindow.DebuggableCallback() get called from Debug.WriteLine()?

P: n/a
caa
Hi there, people!

I m working on a c# control. Using VS2003 and writing for .NET 1.1. I
wrote an app that automaticly opens and closes (after a random Sleep)
forms that own one instance of my control each. While running my
application I'm seeing strange stacks like this:

system.windows.forms.dll!
ControlNativeWindow.WndProc(System.Windows.Forms.M essage m =
{System.Windows.Forms.Message}) + 0xda bytes
system.windows.forms.dll!
System.Windows.Forms.NativeWindow.DebuggableCallba ck(int hWnd =
4196340, int msg = 16, int wparam = 0, int lparam = 0) + 0x39 bytes
system.dll!System.Diagnostics.TraceInternal.WriteL ine(string message =
"blablabla") + 0x4d bytes
system.dll!System.Diagnostics.Debug.WriteLine(stri ng message =
"blablabla") + 0xf bytes

As you see I'm sending a string to the VS output window. BUT! Before
exitting from "Debug.WriteLine" the program decides to go and process
another message. Just how can processing of WM_CLOSE be a part of
Debug.WriteLine?

I looked in Reflector and if the only Listener in Debug.Listeneres
collection is DefaultListener then there is no code in
Debug.WriteLine, except for a call to OutputDebugString.

I hope this some well known feature of WinForms/Win API that I am not
aware of. Please give me a few URLs where I could read about this
stuff.
Thank you.

May 10 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.