: Hi , i just started an mfc sdi based app. I have multiple forms...however...in my main form...i have 4 buttons. I need to connect these buttons to the other forms...inex when the user clicks on button 1 it has to go to another form...How can i do this..
in your main application header file add the include the header file for the new forms class, and in the public or private area of your main application add the class and create an instance of the class for example I have a form that gets a password entered by the user,
the class is "CPassWord" and the instace is "m_CPassWord" so in my header file it looks like this CPassWord m_CPassWord; now in the main applications .cpp file I open the form in my application this way:
// TODO: Add your control notification handler code here
if(m_CPassWord.PasswordOk == TRUE) m_CDefaultEdit.DoModal();
I would suggest to buy the book Teach yourself Visual C++ in 21 days, I think it's published by Sams