Click here to Skip to main content
15,919,898 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: System process Pin
Blake Miller22-Mar-05 5:58
Blake Miller22-Mar-05 5:58 
Generalmfc dll and IWebBrowser2 questions Pin
Spiritofamerica21-Mar-05 10:51
Spiritofamerica21-Mar-05 10:51 
GeneralRe: mfc dll and IWebBrowser2 questions Pin
David Crow21-Mar-05 11:01
David Crow21-Mar-05 11:01 
GeneralRe: mfc dll and IWebBrowser2 questions Pin
Anonymous22-Mar-05 4:55
Anonymous22-Mar-05 4:55 
GeneralWriting Variables in CDialog with MFC Pin
NewbieStats21-Mar-05 9:45
NewbieStats21-Mar-05 9:45 
GeneralRe: Writing Variables in CDialog with MFC Pin
Ravi Bhavnani21-Mar-05 10:01
professionalRavi Bhavnani21-Mar-05 10:01 
GeneralRe: Writing Variables in CDialog with MFC Pin
NewbieStats21-Mar-05 10:19
NewbieStats21-Mar-05 10:19 
GeneralRe: Writing Variables in CDialog with MFC Pin
Ravi Bhavnani21-Mar-05 10:37
professionalRavi Bhavnani21-Mar-05 10:37 
What I meant was, you could use sprintf() (which works exactly like printf() but writes to a string vs. standard output) to display values of variables which could be shown by a static text control (i.e. CStatic) or an edit control (CEdit). The latter is preferred, since it supports scrolling, which can come in handy when displaying large amounts of text.

The actual display would typically occur within a button handler. For example:
CMyDialog::OnBtnFooClicked()
{
  // Better to use a symbolic const instead of "256"
  char szResult [256];

  // Compute and display nFoo
  int nFoo = someFunction(...);
  sprintf (szResult, "nFoo = %d", nFoo);
  m_myEditCtrl.SetWindowText (szResult);

  // Even better to use CString and Format()
  CString strResult;
  strResult.Format ("nFoo = %d", nFoo);
  m_myEditCtrl.SetWindowText (strResult);
Hope this helps.

/ravi

My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com

GeneralRe: Writing Variables in CDialog with MFC Pin
NewbieStats21-Mar-05 10:51
NewbieStats21-Mar-05 10:51 
GeneralRe: Writing Variables in CDialog with MFC Pin
David Crow21-Mar-05 10:57
David Crow21-Mar-05 10:57 
GeneralRe: Writing Variables in CDialog with MFC Pin
Ravi Bhavnani21-Mar-05 11:11
professionalRavi Bhavnani21-Mar-05 11:11 
GeneralRe: Writing Variables in CDialog with MFC Pin
NewbieStats21-Mar-05 11:28
NewbieStats21-Mar-05 11:28 
GeneralRe: Writing Variables in CDialog with MFC Pin
Ravi Bhavnani21-Mar-05 11:38
professionalRavi Bhavnani21-Mar-05 11:38 
GeneralRe: Writing Variables in CDialog with MFC Pin
Ravi Bhavnani21-Mar-05 13:00
professionalRavi Bhavnani21-Mar-05 13:00 
GeneralRe: Writing Variables in CDialog with MFC Pin
NewbieStats21-Mar-05 13:31
NewbieStats21-Mar-05 13:31 
GeneralRe: Writing Variables in CDialog with MFC Pin
Ravi Bhavnani21-Mar-05 13:35
professionalRavi Bhavnani21-Mar-05 13:35 
GeneralRe: Writing Variables in CDialog with MFC Pin
Christian Graus21-Mar-05 13:58
protectorChristian Graus21-Mar-05 13:58 
GeneralRe: Writing Variables in CDialog with MFC Pin
Ravi Bhavnani22-Mar-05 2:12
professionalRavi Bhavnani22-Mar-05 2:12 
GeneralRe: Writing Variables in CDialog with MFC Pin
David Crow21-Mar-05 10:55
David Crow21-Mar-05 10:55 
GeneralProblem with FFT and the Drawing Pin
RedDragon2k21-Mar-05 9:32
RedDragon2k21-Mar-05 9:32 
GeneralRe: Problem with FFT and the Drawing Pin
Alexander M.,21-Mar-05 9:39
Alexander M.,21-Mar-05 9:39 
GeneralRe: Problem with FFT and the Drawing Pin
RedDragon2k21-Mar-05 9:49
RedDragon2k21-Mar-05 9:49 
GeneralCritcal Section question Pin
Tom Wright21-Mar-05 8:47
Tom Wright21-Mar-05 8:47 
GeneralRe: Critcal Section question Pin
David Crow21-Mar-05 8:55
David Crow21-Mar-05 8:55 
GeneralRe: Critcal Section question Pin
Tom Wright21-Mar-05 12:12
Tom Wright21-Mar-05 12:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.