Click here to Skip to main content
16,004,924 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DLL Thread_attach Pin
Mark Salsbery9-Apr-08 12:58
Mark Salsbery9-Apr-08 12:58 
GeneralRe: DLL Thread_attach Pin
ForNow9-Apr-08 13:09
ForNow9-Apr-08 13:09 
GeneralRe: DLL Thread_attach Pin
Mark Salsbery9-Apr-08 13:11
Mark Salsbery9-Apr-08 13:11 
GeneralRe: DLL Thread_attach Pin
ForNow9-Apr-08 13:15
ForNow9-Apr-08 13:15 
GeneralRe: DLL Thread_attach Pin
Mark Salsbery9-Apr-08 13:20
Mark Salsbery9-Apr-08 13:20 
GeneralRe: DLL Thread_attach Pin
ForNow9-Apr-08 13:25
ForNow9-Apr-08 13:25 
GeneralRe: DLL Thread_attach Pin
Mark Salsbery9-Apr-08 8:05
Mark Salsbery9-Apr-08 8:05 
GeneralRe: DLL Thread_attach Pin
cmk9-Apr-08 19:25
cmk9-Apr-08 19:25 
To set a thread name while debugging, as Mark mentioned:

void  utl::SetThreadName( cchar *NAME, DWORD ID )
{
	struct {
		DWORD   Type;   // must be 0x1000
		cchar  *Name;   // pointer to name (in user addr space)
		DWORD   Id;     // thread ID (-1=caller thread)
		DWORD   Flags;  // reserved for future use, must be zero
	}	info = { 0x1000, NAME, ID, 0 };
	__try
	{
		::RaiseException(0x406D1388, 0, sizeof(info)/sizeof(DWORD), (ULONG_PTR*)&info);
	}
	__except(EXCEPTION_CONTINUE_EXECUTION)
	{
	}
}


There is no way to get the name back.

If you really want to associate a name with a thread then use some variant of TLS.

When you get the THREAD_ATTACH is fairly well spelled out in the MSDN docs, what part don't you understand ?

...cmk

The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack

GeneralRe: DLL Thread_attach Pin
ForNow10-Apr-08 6:16
ForNow10-Apr-08 6:16 
GeneralRe: DLL Thread_attach Pin
cmk10-Apr-08 6:41
cmk10-Apr-08 6:41 
GeneralRe: DLL Thread_attach Pin
ForNow10-Apr-08 13:48
ForNow10-Apr-08 13:48 
GeneralRe: 32 bit version of StackWalk64 Pin
ForNow10-Apr-08 15:44
ForNow10-Apr-08 15:44 
GeneralCenter dialog to the screen Pin
RomTibi9-Apr-08 5:52
RomTibi9-Apr-08 5:52 
GeneralRe: Center dialog to the screen Pin
David Crow9-Apr-08 5:58
David Crow9-Apr-08 5:58 
GeneralRe: Center dialog to the screen Pin
Hamid_RT11-Apr-08 7:10
Hamid_RT11-Apr-08 7:10 
GeneralProb with Bitmap Pin
Schehaider_Aymen9-Apr-08 5:16
Schehaider_Aymen9-Apr-08 5:16 
QuestionRe: Prob with Bitmap Pin
David Crow9-Apr-08 5:20
David Crow9-Apr-08 5:20 
GeneralRe: Prob with Bitmap Pin
Schehaider_Aymen9-Apr-08 5:30
Schehaider_Aymen9-Apr-08 5:30 
GeneralRe: Prob with Bitmap Pin
Schehaider_Aymen9-Apr-08 5:39
Schehaider_Aymen9-Apr-08 5:39 
GeneralRe: Prob with Bitmap Pin
Mark Salsbery9-Apr-08 5:44
Mark Salsbery9-Apr-08 5:44 
GeneralRe: Prob with Bitmap Pin
Schehaider_Aymen9-Apr-08 5:48
Schehaider_Aymen9-Apr-08 5:48 
GeneralRe: Prob with Bitmap Pin
Mark Salsbery9-Apr-08 6:07
Mark Salsbery9-Apr-08 6:07 
GeneralRe: Prob with Bitmap Pin
Schehaider_Aymen9-Apr-08 6:13
Schehaider_Aymen9-Apr-08 6:13 
GeneralRe: Prob with Bitmap Pin
Mark Salsbery9-Apr-08 6:17
Mark Salsbery9-Apr-08 6:17 
GeneralRe: Prob with Bitmap Pin
Hamid_RT10-Apr-08 23:52
Hamid_RT10-Apr-08 23:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.