Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message Map Question

Status
Not open for further replies.

Kalisto

Programmer
Joined
Feb 18, 2003
Messages
997
Location
GB
Afternoon. I have an Event handler which I want to call the function OnBnClickedBuildFile()

I want this function to be able to return a Bool value to indicate whether it has succeeded or not.

afx_message void OnBnClickedBuildfile
to
afx_message bool OnBnClickedBuildfile

But when I try to compile, I get an error "C2440 Static Cast", and it highlights the line below as the source of the error

ON_BN_CLICKED(IDC_BUILDFILE, OnBnClickedBuildfile)

I assume it is possible to do what I am trying, so what do I need to change to get this to work ?

TIA,

K
 
But its a response to a message! Whoever sent the message isn't expecting any return value, and wouldn't know what to do with it anyway.

You would more likely have to do some on-failure handling in the OnBnClickedBuildfile itself.

/Per

if (typos) cout << &quot;My fingers are faster than my brain. Sorry for the typos.&quot;;
 
OK, thanks.
I was trying to be lazy, but now I guess I can't be.

Cheers,
K
 
There's no such thing as a free lunch.

Alas.



/Per

if (typos) cout << &quot;My fingers are faster than my brain. Sorry for the typos.&quot;;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top