How to let buttons work on PropertyPage?

I have a propertyPage and I put a "Button" on it and I also implement
function: OnButton(), when I click this button, it should
popup another dialog, but there is nothing happens when it is clicked.
When I put the MessageBox at first line of this function, when I click
the "Button", still there is no any reaction, how to get command message
when you click button on propertyPage? Urgent!!

Hanqian.
Thanks.
HanqianAsked:
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.

abelblaine111Commented:
If you are using MFC then you can do this.. Delete what you have then go to the class wizard.
Select the class that has the button.
Go to Message Maps tab.
In Object ID's select the button ID.
Click on the message you wand to add.
Click on the Add Function Button.

That will do it.

If you arent using MFC, or you want to hand add the handlers do this.

in the .h of the class that has the button add this to the protected section.

afx_msg void OnMyFunction();

then in the .c/.cpp

BEGIN_MESSAGE_MAP(CMyClass, CDialog)
   ON_BN_CLICKED(IDOFYOURBUTTON, OnMyFunction)

END_MESSAGE_MAP()

0
abelblaine111Commented:
In the property Page the BEGIN_MESSAGE_MAP will have CPropertyPage of course.  The code works the same.
0
moduloCommented:
Dear expert(s),

A request has been made to close this Q in CS:
http://www.experts-exchange.com/Community_Support/Q_20598694.html

Without a response in 72 hrs, a moderator will finalize this question by:

 - Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.

modulo

Community Support Moderator
Experts Exchange
0
moduloCommented:
Saving this Q as a PAQ and refunding the 125 points to the questionner

modulo

Community Support Moderator
Experts Exchange
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
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
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.