11-04-2004, 02:01 PM | #1 (permalink) |
Tilted
Location: Maryland
|
MFC C++ Naming threads for debugger
Inside MS Dev Studio 2003.net when you are debugging and looking at the threads window. The name of most of the threads is "_threadstartex". Is there a way to assign a useful name to the thread so I can very quickly look in this window and figure out what the threads are? Thanks
|
11-05-2004, 03:52 PM | #2 (permalink) |
Tilted
|
I'm assuming the app you are developing is .NET and not, say a regular console/C++ app using windows threads. On the Thread class there is a property called "name". I would think that MS/VS would use this property for display purposes, but I haven't done enough .NET programming to know for sure.
http://msdn.microsoft.com/library/de...mberstopic.asp |
11-06-2004, 12:24 AM | #4 (permalink) | ||
Junkie
Location: San Francisco
|
Quote:
Quote:
CWinThread * pThread = AfxBeginThread(...); SetThreadName(pThread->m_nThreadID, "Foo"); edit: fixed a typo in the doc: the line info.dwThreadID = dwThreadID; was originally info.dwThreadID = dwThread; but that's obviously a compiler error since there is no variable dwThread. Last edited by n0nsensical; 11-06-2004 at 03:58 AM.. |
||
Tags |
debugger, mfc, naming, threads |
|
|