JIT Debugging...PID Invalid from ID3DXFont?
I just implemented drawing text to the screen in my DirectX engine using ID3DXFont, and I'm having weird sporatic JIT errors pop up. Every once and a while, when I close the window, I'll have a JIT Debugging box pop up that says "PID is invalid" with an "OK" box to click.
I can only assume that it has to do with the font interface, since commenting out that part of the engine remedies the issue, and I've never seen this error before I tried to implement it. However I can't seem to figure out where the error is coming form.
If anyone has had this error pop up and figured out what it was, I'd appreciate any ideas you have.
Thanks
Ok, after checking something that I thought was ok...it turns out that it's not the Font interface (I think)
I'm currently separating the message pump from the game by creating a game thread after everything is initialized. It seems that if I remove this multithreading, and just run everything in the traditional "while(message.msg != WM_QUIT)" loop, everything is fine. So I guess my PID invalid error is a result of something going wrong in my threading.
What I have is along the lines of the following:
-CoInitalizeEx w/ Multithreading
-Initialize window, d3d, dsound, input etc
-Create game thread
-start message pump (while msg != WM_QUIT)
then in my game thread:
while(alive)
// do game stuff
endwhile
postmessage(hWnd, WM_CLOSE, 0 , 0)
return 0
I also noticed that this error does not occur when the game thread terminates itself (i.e. the game finishes and sets alive to false, then calls the PostMessage() itself)...rather, it only occurs when the window is terminated by clicking the "X" button on the actual window.
So is there something wrong with the way I'm implementing the multithreading maybe? Is it the case that all my initialization and such needs to be done in the game thread instead of before I do the CreateThread? Maybe there is a special message I need to handle differently in the pump? or is there something else I'm overlooking?
Thanks for any advice anyone has on the issue.
[Edited by - Antrim on October 21, 2005 1:02:17 AM]
I'm currently separating the message pump from the game by creating a game thread after everything is initialized. It seems that if I remove this multithreading, and just run everything in the traditional "while(message.msg != WM_QUIT)" loop, everything is fine. So I guess my PID invalid error is a result of something going wrong in my threading.
What I have is along the lines of the following:
-CoInitalizeEx w/ Multithreading
-Initialize window, d3d, dsound, input etc
-Create game thread
-start message pump (while msg != WM_QUIT)
then in my game thread:
while(alive)
// do game stuff
endwhile
postmessage(hWnd, WM_CLOSE, 0 , 0)
return 0
I also noticed that this error does not occur when the game thread terminates itself (i.e. the game finishes and sets alive to false, then calls the PostMessage() itself)...rather, it only occurs when the window is terminated by clicking the "X" button on the actual window.
So is there something wrong with the way I'm implementing the multithreading maybe? Is it the case that all my initialization and such needs to be done in the game thread instead of before I do the CreateThread? Maybe there is a special message I need to handle differently in the pump? or is there something else I'm overlooking?
Thanks for any advice anyone has on the issue.
[Edited by - Antrim on October 21, 2005 1:02:17 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement