Solved

displaying non-document items

Posted on 1999-01-02
1
154 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Running shell command from Access 3 68
Folder Comparison 12 53
Annoying "thing" blocks my view 4 80
Is there a simple front-end menu system. 9 70
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.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

919 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now