Click here to Skip to main content
15,896,606 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Sending message to WindowProc() Pin
Randor 22-Jul-07 20:18
professional Randor 22-Jul-07 20:18 
GeneralRe: Sending message to WindowProc() Pin
rp_suman22-Jul-07 20:36
rp_suman22-Jul-07 20:36 
GeneralRe: Sending message to WindowProc() Pin
Randor 22-Jul-07 21:13
professional Randor 22-Jul-07 21:13 
GeneralRe: Sending message to WindowProc() Pin
rp_suman22-Jul-07 21:47
rp_suman22-Jul-07 21:47 
GeneralRe: Sending message to WindowProc() Pin
Stephen Hewitt22-Jul-07 22:02
Stephen Hewitt22-Jul-07 22:02 
GeneralRe: Sending message to WindowProc() [modified] Pin
rp_suman22-Jul-07 22:32
rp_suman22-Jul-07 22:32 
GeneralRe: Sending message to WindowProc() Pin
sw@thi22-Jul-07 23:02
sw@thi22-Jul-07 23:02 
GeneralRe: Sending message to WindowProc() Pin
Randor 23-Jul-07 2:16
professional Randor 23-Jul-07 2:16 
Hello again,

I am happy that your issue has been resolved. But, so you can learn from this experience with others... let me explain my theory about what was happening.

You stated that you were calling AfxGetMainWnd() from within a callback function. Callbacks are often not excuting within the same thread as the main window. They may be called from an external thread.

From the MSDN: http://msdn2.microsoft.com/en-us/library/waas15s1(VS.80).aspx[^]

"If AfxGetMainWnd is called from the application's primary thread, it returns the application's main window according to the above rules. If the function is called from a secondary thread in the application, the function returns the main window associated with the thread that made the call."

Best Wishes,
-Randor (David Delaune)
GeneralRe: Sending message to WindowProc() Pin
rp_suman23-Jul-07 3:06
rp_suman23-Jul-07 3:06 
AnswerRe: Sending message to WindowProc() Pin
Stephen Hewitt22-Jul-07 21:13
Stephen Hewitt22-Jul-07 21:13 
GeneralRe: Sending message to WindowProc() Pin
rp_suman22-Jul-07 21:57
rp_suman22-Jul-07 21:57 
QuestionADO Fails to Add New Record In Database, Code compiles and runs fine Pin
shivditya22-Jul-07 17:44
shivditya22-Jul-07 17:44 
QuestionTwo localization questions Pin
mid=574122-Jul-07 16:34
mid=574122-Jul-07 16:34 
AnswerRe: Two localization questions Pin
Sameerkumar Namdeo22-Jul-07 21:06
Sameerkumar Namdeo22-Jul-07 21:06 
GeneralRe: Two localization questions Pin
mid=574123-Jul-07 4:58
mid=574123-Jul-07 4:58 
QuestionHide dialog in ObjectArx Pin
Legolas6522-Jul-07 13:39
Legolas6522-Jul-07 13:39 
QuestionHow to add a resource to an external exe file? Pin
Manthis22-Jul-07 13:20
Manthis22-Jul-07 13:20 
AnswerRe: How to add a resource to an external exe file? Pin
Michael Dunn22-Jul-07 14:13
sitebuilderMichael Dunn22-Jul-07 14:13 
AnswerRe: How to add a resource to an external exe file? Pin
ThatsAlok22-Jul-07 17:49
ThatsAlok22-Jul-07 17:49 
AnswerRe: How to add a resource to an external exe file? Pin
Sameerkumar Namdeo22-Jul-07 21:15
Sameerkumar Namdeo22-Jul-07 21:15 
AnswerRe: How to add a resource to an external exe file? Pin
Manthis23-Jul-07 11:20
Manthis23-Jul-07 11:20 
QuestionBinary tree question. NEED INFO FAST..thanks Pin
diablaaz22-Jul-07 11:27
diablaaz22-Jul-07 11:27 
AnswerRe: Binary tree question. NEED INFO FAST..thanks Pin
DevMentor.org22-Jul-07 19:12
DevMentor.org22-Jul-07 19:12 
QuestionC++ programming question [modified] Pin
diablaaz22-Jul-07 11:25
diablaaz22-Jul-07 11:25 
AnswerRe: C++ programming question Pin
Malcolm Smart22-Jul-07 11:32
Malcolm Smart22-Jul-07 11:32 

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.