Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9248319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:55:08+00:00 2026-06-18T09:55:08+00:00

Currently writing a dialog based application in MFC that creates a child dialog when

  • 0

Currently writing a dialog based application in MFC that creates a child dialog when a button on the main dialog is pushed. The child dialog then has 3 edit control boxes and one button. When the button is pressed the information from the three edit control boxes is retrieved and stored as separate CStrings. Those CStrings are passed to a function located in the Main Dlg.cpp. That function takes the those strings and inserts them in a list control. The program builds fine and runs up until the add button(on the child dialog) is pressed. Not sure why the program is crashing I appear to have correct arguments?I’m also not sure if this is the best way to pass data like this between two dialog boxes. Any better ideas with that are also appreciated.

Popup Add Button Function

 void Popup::OnBnClickedPopadd()
   {
    CString str1, str2, str3;
    CThermotronDlg dlg;
    GetDlgItemText(ID_RampEdit,str1);
    GetDlgItemText(ID_DwellEdit,str2);
    GetDlgItemText(ID_TempEdit,str3);

    dlg.ReciveAndDisplay(str1,str2,str3);
   }

Receive and Display Function

 void CThermotronDlg::ReciveAndDisplay(CString str1, CString str2,CString str3){

    LPCTSTR ramp(str1),dwell(str2),temp(str3);

    MyListEx.InsertItem(1,ramp);
    MyListEx.SetItemText(0,1,dwell);
    MyListEx.SetItemText(0,2,temp);


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:55:09+00:00Added an answer on June 18, 2026 at 9:55 am

    Instead of initialising the variable CThermotronDlg dlg; in your popup dialog, you need to locate the main dialog’s address and call ReceiveAndDisplay method of this dialog directly. One of the way of doing this is by accessing the m_pMainWnd public variable of your application object (theApp). The proper code of OnBnClickedPopadd() will be:

     void Popup::OnBnClickedPopadd()
       {
        CString str1, str2, str3;
        CThermotronDlg *pDlg = (CThermotronDlg*)theApp.m_pMainWnd;
        GetDlgItemText(ID_RampEdit,str1);
        GetDlgItemText(ID_DwellEdit,str2);
        GetDlgItemText(ID_TempEdit,str3);
    
        pDlg->ReciveAndDisplay(str1,str2,str3);
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently writing a program using Weka that builds a model (using one
I'm currently writing a simple app that performs a series of requests to the
I am currently writing a simple IOS app that saves tasks into a table.
I'm currently writing a billing application using EF 5 Code First, and I'm running
I'm currently writing a Powershell script that's used to select a user from Active
I'm currently writing a small python app that embeds cherrypy and django using py2app.
I'm currently writing a live wallpaper for Android and it has a PreferenceScreen which
I'm writing an app that requires a TimePicker-based preference (two, actually) and I swiped
I'm currently writing a pure GWT (2.3) application and I require the use of
I'm currently writing a program that will use the Geocoder to search for possible

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.