SrinivasaRao
asked on
UI thread problem
Hi
I am creating one user interface thread, which intern creates a dialog box.This dialog box is handling windows messages like WM_TIMER, WM_CREATE very well. Problem is arising when i am sending a user defined message. Message is being posted to the dialog box and the corresponding function is executing. But in the function its showing this as NULL and hWnd as ???. I am using PostMessage() to post message. I tried with PostThreadMessage, but no result. I replaced ON_MESSAGE WITH ON_THREAD_MESSAGE, but the problem persists.
One thing I am amazing is that why cant it deals with user defined messages, when it can handle Windows messages. I hope i get some help from u.
Thank u in anticipation.
regards,
bsr
I am creating one user interface thread, which intern creates a dialog box.This dialog box is handling windows messages like WM_TIMER, WM_CREATE very well. Problem is arising when i am sending a user defined message. Message is being posted to the dialog box and the corresponding function is executing. But in the function its showing this as NULL and hWnd as ???. I am using PostMessage() to post message. I tried with PostThreadMessage, but no result. I replaced ON_MESSAGE WITH ON_THREAD_MESSAGE, but the problem persists.
One thing I am amazing is that why cant it deals with user defined messages, when it can handle Windows messages. I hope i get some help from u.
Thank u in anticipation.
regards,
bsr
ASKER
hi,
The declaration of the handler function is :
LRESULT CALLBACK FunctionName( WPARAM, LPARAM );
I am using vc++ 6.0
bsr
The declaration of the handler function is :
LRESULT CALLBACK FunctionName( WPARAM, LPARAM );
I am using vc++ 6.0
bsr
Hi!
try remove CALLBACK modifiers for your handler
try remove CALLBACK modifiers for your handler
2 SrinivasaRao
Did you try
AFX_MANAGE_STATE(AfxGetSta ticModuleS tate( ));
at the function begin
Did you try
AFX_MANAGE_STATE(AfxGetSta
at the function begin
ASKER
its working when the declaration is : afx_msg void functionname() .
But after execution of the method its throwing Access Violation Error!!!!
unable to trace the things:)
bsr
But after execution of the method its throwing Access Violation Error!!!!
unable to trace the things:)
bsr
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you show declaration of the CustomMessage handler int the dialog class?