Does an event handler function run as a separate thread?

Say I have a event handler function OnCallingSomeFunction

i.e. ON_COMMAND(ID_OPTION_SOME_FUNCTION, OnCallingSomeFunction)

when a user activates this function, does it run as a separate thread? if a user activates it a second time before the first call is finished, would these 2 calls be running in separate threads?

thanks
LVL 1
DrivenXAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
No, MFC in general runs all UI related functions in one (the main) thread, so what you lined out should not happen. What you however can do is launching a thread for processing in that event handler and return immediately.
0
DrivenXAuthor Commented:
Thanks jkr

Just a little bit confused.  Then, should the application wait for one handler function to finish before executing another?  It seems that 2 handler functions are running at the same time in my application.
0
jkrCommented:
That would be really odd, unless you kick off another thread by yourself. However, when the handler just creates a window and returns then, this would be possible, since the "parallelism" would be possible through messaging then.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DrivenXAuthor Commented:
Hmm my handler does involve calling a CWnd derived class' function, perhaps that's why.  Although it the handler function does not return right away.

Thanks jkr
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.