VC++ .Net
-
Hi, I was playing around a little with .Net, just for fun and created a dialog based project. I added a button to my dialog and created an OnBnClickedButton1() function. But I tried to make this function return a BOOL rather than being void. I then get the following error message: error C2440: static_cast: cannot convert from BOOL(__thiscall CSampleDlg::*)(void) to AFX_PMSG. Anyone can explain to me how does one make this function return something. Or is it not allowed in .Net? Thanks Regards Rui
-
Hi, I was playing around a little with .Net, just for fun and created a dialog based project. I added a button to my dialog and created an OnBnClickedButton1() function. But I tried to make this function return a BOOL rather than being void. I then get the following error message: error C2440: static_cast: cannot convert from BOOL(__thiscall CSampleDlg::*)(void) to AFX_PMSG. Anyone can explain to me how does one make this function return something. Or is it not allowed in .Net? Thanks Regards Rui
VC.NET has improved type checking in message maps. The header of your function is simply not compatible with ON_CONTROL event handler. Anyway, it's MFC who calls your handler - so return value is ignored. Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
-
Hi, I was playing around a little with .Net, just for fun and created a dialog based project. I added a button to my dialog and created an OnBnClickedButton1() function. But I tried to make this function return a BOOL rather than being void. I then get the following error message: error C2440: static_cast: cannot convert from BOOL(__thiscall CSampleDlg::*)(void) to AFX_PMSG. Anyone can explain to me how does one make this function return something. Or is it not allowed in .Net? Thanks Regards Rui