Solved

displaying non-document items

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 150
Detect CR LF to each line 12 137
List out all word 7 224
notReplace  challenge 53 102
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

23 Experts available now in Live!

Get 1:1 Help Now