Thread Names & VC++

I seem to remember that there was some hack you could do in your program that would trick VC++
into displaying names for threads, so that with a number of threads, you could figure find the one you
wanted quickly.

Can anyone give me a pointer to this?

Thanks,
-DH


Dave Harvey, System Software Solutions, Inc.
617-964-7039, FAX 208-361-9395, xxxxx@syssoftsol.com, http://www.syssoftsol.com
Creators of RedunDisks - Robust RAID 1 for embedded systems.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

/*
VC 6.0 extensions
*/

/*
Set thread name for VC 6.0 debugger
*/
#ifdef _DEBUG
typedef struct sTHREADNAME_INFO {
DWORD dwType;
LPCSTR szName;
DWORD dwThreadId;
DWORD dwFlags;
} THREADNAME_INFO;
void SetThreadName(
DWORD dwThread,
LPCSTR szThreadName,
DWORD dwFlags)
{
THREADNAME_INFO l_Info;
l_Info.dwType = 0x1000;
l_Info.szName = szThreadName;
l_Info.dwThreadId = dwThread;
l_Info.dwFlags = dwFlags;
__try {
RaiseException(
0x406D1388,
0,
sizeof(l_Info) / sizeof(DWORD),
(DWORD *)(&l_Info)
);
} __except (EXCEPTION_CONTINUE_EXECUTION) {
}
}
#endif

rob

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Dave Harvey
Sent: Wednesday, March 21, 2001 10:11 PM
To: NT Developers Interest List
Subject: [ntdev] Thread Names & VC++

I seem to remember that there was some hack you could do in your
program that would trick VC++
into displaying names for threads, so that with a number of
threads, you could figure find the one you
wanted quickly.

Can anyone give me a pointer to this?

Thanks,
-DH



Dave Harvey, System Software Solutions, Inc.
617-964-7039, FAX 208-361-9395, xxxxx@syssoftsol.com,
http://www.syssoftsol.com
Creators of RedunDisks - Robust RAID 1 for embedded systems.


You are currently subscribed to ntdev as: xxxxx@cdp.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com