Solved

displaying non-document items

Posted on 1999-01-02
1
157 Views
Last Modified: 2013-11-20
  I am developing a dialog-box based application that receives input from the user through an edit-box. What I want the program to do is to perform some calculations using this input plus some other data from the program's document class and display the results. The results themselves are not part of the document class(in fact this is a database application and uses a recordset). From what I can gather, data is displayed by linking a dialog control with a data member. What happens if the information to be displayed is not a data member? I really don't want to make these results part of my document class as it will affect the entire database. Probably a simple solution but I am new to using MFC.
0
Comment
Question by:mspx
1 Comment
 
LVL 1

Accepted Solution

by:
dvest earned 50 total points
ID: 1327121
Once you have the result of your calculation, you could show the results as follows:

OnCalculationComplete(CString result)
{
      CEdit* pEdit;
      pEdit=(CEdit*)GetDlgItem(IDC_RESULT); //set ptr to your edit box
      pEdit->SetWindowText(result);
}

If the answer is numeric, you can convert it like this:
char buffer[12]; //use max # of digits in place of "12"
itoa(integerResult, buffer, 10);
// the "10" in this call is the base of the number (base 10, octal,hex,etc.)
CString result=buffer;

I hope this is what you are after.  Let me know if clarification is needed.
David
      
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 162
Tab names are off by one 5 54
dog bark java program 15 119
EvenOdd challenge 10 144
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question