dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Messagebox

  1. #1
    Join Date
    Jul 2018
    Posts
    11

    Messagebox

    i am very new to vc++.
    how do i print the string entered in the edit box into the message box?i am using
    MessageBox("id:","title",MB_OK);

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,258

    Re: Messagebox

    Quote Originally Posted by Ramdhyani View Post
    i am very new to vc++.
    how do i print the string entered in the edit box into the message box?i am using
    MessageBox("id:","title",MB_OK);
    1. What type of MessageBox are you going to use? Is it a Win32 API ::MessageBox? Or the CWnd::MessageBox?
    And if you are using MFC than why not use the AfxMessageBox?

    2. What exactly is your problem? Reading some text from a edit box or putting it into the MessageBox call?

    3. There is a lot of examples how to use MessageBox/AfxMessageBox in c++ code: https://www.google.de/search?newwind....0.b3xeIZmR7oc
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2018
    Posts
    11

    Re: Messagebox

    Quote Originally Posted by VictorN View Post
    1. What type of MessageBox are you going to use? Is it a Win32 API ::MessageBox? Or the CWnd::MessageBox?
    And if you are using MFC than why not use the AfxMessageBox?

    2. What exactly is your problem? Reading some text from a edit box or putting it into the MessageBox call?

    3. There is a lot of examples how to use MessageBox/AfxMessageBox in c++ code: https://www.google.de/search?newwind....0.b3xeIZmR7oc
    i am using AfxMessageBox..
    i want to read from the edit and put the same thing back to messagebox

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,805

    Re: Messagebox

    Quote Originally Posted by Ramdhyani View Post
    i am using AfxMessageBox..
    i want to read from the edit and put the same thing back to messagebox
    Post your code that is displaying the edit box. Please use code tags.

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,258

    Re: Messagebox

    Quote Originally Posted by Ramdhyani View Post
    i am using AfxMessageBox..
    i want to read from the edit and put the same thing back to messagebox
    Use the MFC Class Wizard to create a control member variable for the edit control (say, it would be m_myEdit).
    Then add this (pseudo)code to read text and display the message:
    Code:
    CString myText;
    m_myEdit.GetWindowText(myText );
    
    AfxMessageBox(myText);
    Victor Nijegorodov

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)