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

  • Home
  • SEARCH
  • 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 6072121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:07:30+00:00 2026-05-23T10:07:30+00:00

Language : C++ Development Environment : Microsoft Visual C++ Libraries Used : MFC Problem

  • 0

Language: C++

Development Environment: Microsoft Visual C++

Libraries Used: MFC

Problem: I have created a preference configuration application. To the left is a list box with the “parent” categories of settings they can change, and when they click one, the settings they can change appear to the right of the list box, like in many large preference dialogs. I have all of my controls set up with DDX data exchanges (note: I have a cpp file for EACH sub-dialog/preference page), so I have all of the groundwork set.

Here’s my issue. I’m having a hard time using UpdateData because I never actually call DoModal() on the preference boxes because they’re children of the parent dialog container, and they are just bound to the picture control in the dialog. I perform a combination of setting focus and showing/hiding the sub-dialogs when the user clicks through the listbox.

When the user selects “Save These” he/she is presented with another dialog that allows them to check which specific preference panes they want to save (to generate XML configuration files). Obviously I need to scrape the dialog for their inputs, but when the program reaches the point in the code where it calls UpdateData, the program fails, because I’m calling UpdateData before calling DoModal().

Now I’m not really sure how to go about getting the values. It doesn’t help either that I’m very new to MFC. So there’s that. Anyhow, I would appreciate any help that anyone can offer.

  • 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-05-23T10:07:30+00:00Added an answer on May 23, 2026 at 10:07 am

    User experience could possibly be improved by using CTabCtrl which provides the kind of functionality you seem to be implementing.

    In general you aren’t meant to call UpdateData directly in most cases this is a framework mechanic called by OnInitDialog to load and OnOK to save for modal dialogs. This is not loading and saving in the sense you might be thinking. What it does is load the control values from the resource or member variables in OnInitDialog then when the user clicks OK it validates and saves the values of the controls on the dialog into the member variables. This is the mechanic that allows you to display previous values when reopening the dialog as well as getting the values out after they close it.

    You can look into CArchive and serializing your dialogs but I would suggest writing your own saving/loading framework especially if dealing with XML configuration files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Language : C++ Development Environment : Microsoft Visual C++ Libraries Used : MFC Problem
I heard that C# is a rapid application development (RAD) language. Even after reading
I am very interested in mobile application development. But which language or framework is
Ubuntu 10.04 64-bit looks promising as a development environment for Android. I now have
Development Environment: Eclipse 3.7.0 Developing: Android 3.2 application for Market Place Using: aChartEngine 0.7.0
I have just finished learning application development on android platform, as In matter of
This is trouble shooting question. Our application's development environment is VS2005 C/C++, VB6 based
In the application I'm writing using a combination of development environments and languages, I
If Delphi is the primary language for my development, what is the ideal complement
.NET Framework: 2.0 Preferred Language: C# I am new to TDD (Test Driven Development).

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.