Click here to Skip to main content
15,902,299 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: DC to Bitmap Pin
CPallini27-Aug-09 22:38
mveCPallini27-Aug-09 22:38 
GeneralRe: DC to Bitmap Pin
LuisFilipeSa27-Aug-09 23:42
LuisFilipeSa27-Aug-09 23:42 
GeneralRe: DC to Bitmap Pin
CPallini27-Aug-09 23:56
mveCPallini27-Aug-09 23:56 
GeneralRe: DC to Bitmap Pin
LuisFilipeSa30-Aug-09 23:33
LuisFilipeSa30-Aug-09 23:33 
QuestionOleDb Application Pin
andrew_dk27-Aug-09 21:50
andrew_dk27-Aug-09 21:50 
QuestionTracking tooltip double-click problem when using XP manifest (ComCtl32.dl) [modified] Pin
Moak27-Aug-09 13:48
Moak27-Aug-09 13:48 
AnswerRe: Tracking tooltip double-click problem when using XP manifest (ComCtl32.dl) Pin
Moak1-Sep-09 4:25
Moak1-Sep-09 4:25 
QuestionUsing GetThreadContext to get the Program Counter of a thread Pin
Code-o-mat27-Aug-09 11:15
Code-o-mat27-Aug-09 11:15 
Hello people!

I wrote a little test application to experiment with GetThreadContext[^]. In this application, which is actually a dialog based application, i have 3 threads, the GUI thread, a thread that runs a few pointless loops and one that regularry enumerates the threads belonging to this process and calls GetThreadContext on each thread. In the enumeration i use CreateToolhelp32Snapshot[^] method and Thread32First[^]/Thread32Next[^] to get the thread IDs, then i use OpenThread[^] specifying the flag THREAD_GET_CONTEXT to gain the handle of the thread and then i feed GetThreadContext with this handle. In the CONTEXT struct i get the info in i give CONTEXT_CONTROL for the ContextFlags member, as found in winnt.h, to get the program counter (that's Eip, right?). And here comes the part i do not understand and require some help with. For each thread i am getting a different value in the Eip, that is understandable, since the 3 threads are executing different parts of the code, however, this value never seems to be changing in time, what i mean is, if i run my program and for a given thread i get -let's say- 12345678 for Eip, it will still be 12345678 in 10 secs, 15 secs, 1 minutes, it never seems to change. What i would expect is that this value keeps changing as the thread runs and executes different parts of the code. Btw all the rest of the registers i get if i specify CONTEXT_CONTROL behaves the same way. Can anyone explain me why and maybe give me a hint how i could actually get the program counter the correct way for the threads? (The point of this all is that i just want to see if i can detect deadlocked threads this way or not.)

> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <

GeneralRe: Using GetThreadContext to get the Program Counter of a thread Pin
harold aptroot27-Aug-09 11:48
harold aptroot27-Aug-09 11:48 
GeneralRe: Using GetThreadContext to get the Program Counter of a thread Pin
Code-o-mat27-Aug-09 12:07
Code-o-mat27-Aug-09 12:07 
GeneralRe: Using GetThreadContext to get the Program Counter of a thread Pin
harold aptroot27-Aug-09 12:11
harold aptroot27-Aug-09 12:11 
GeneralRe: Using GetThreadContext to get the Program Counter of a thread Pin
Code-o-mat27-Aug-09 20:19
Code-o-mat27-Aug-09 20:19 
Questionraw input only to an application Pin
Manikandan27-Aug-09 7:47
Manikandan27-Aug-09 7:47 
QuestionIllegal Indirection Error - CertFindChainInStore Pin
mypicturefaded27-Aug-09 6:24
mypicturefaded27-Aug-09 6:24 
AnswerRe: Illegal Indirection Error - CertFindChainInStore Pin
Rajesh R Subramanian27-Aug-09 6:42
professionalRajesh R Subramanian27-Aug-09 6:42 
GeneralRe: Illegal Indirection Error - CertFindChainInStore Pin
mypicturefaded27-Aug-09 6:50
mypicturefaded27-Aug-09 6:50 
GeneralRe: Illegal Indirection Error - CertFindChainInStore Pin
Rajesh R Subramanian27-Aug-09 9:52
professionalRajesh R Subramanian27-Aug-09 9:52 
GeneralRe: Illegal Indirection Error - CertFindChainInStore Pin
David Crow27-Aug-09 10:05
David Crow27-Aug-09 10:05 
GeneralRe: Illegal Indirection Error - CertFindChainInStore Pin
mypicturefaded27-Aug-09 10:06
mypicturefaded27-Aug-09 10:06 
QuestionRe: Illegal Indirection Error - CertFindChainInStore Pin
David Crow27-Aug-09 10:40
David Crow27-Aug-09 10:40 
AnswerRe: Illegal Indirection Error - CertFindChainInStore Pin
mypicturefaded28-Aug-09 4:33
mypicturefaded28-Aug-09 4:33 
GeneralRe: Illegal Indirection Error - CertFindChainInStore Pin
Randor 28-Aug-09 5:07
professional Randor 28-Aug-09 5:07 
QuestionMaximize window Pin
zhenek9127-Aug-09 4:49
zhenek9127-Aug-09 4:49 
AnswerRe: Maximize window Pin
«_Superman_»27-Aug-09 16:40
professional«_Superman_»27-Aug-09 16:40 
AnswerRe: Maximize window Pin
ThatsAlok28-Aug-09 0:40
ThatsAlok28-Aug-09 0:40 

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.