Quote Originally Posted by Beginner_MFC View Post
When member function whose return type is int is placed inside the ON_COMMAND of BEGIN_MESSAGE_MAP, It shows error of invalid type conversion.
Yep, ON_COMMAND() macro expects the function to look like
Code:
afx_msg void func();
Suggest whats the alternative for that or how can i pass int return function .
The the only way to satisfy the compiler is to give it what it wants. In other words, you either change the func to return nothing or otherwise provide a wrapper function, something like that:

Code:
afx_msg int func();

afx_msg void cmd_func()
{
    int ret = func();
    TRACE("func() returned %d\n", ret);
}