GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 24-Sep-2004, 08:32
Frandy Frandy is offline
New Member
 
Join Date: Sep 2004
Location: Italy
Posts: 19
Frandy is on a distinguished road
Unhappy

Dialog based application : updating


Hello:
I've created a dialog for a math C program, the output of which is stored in an array as double variables.
The associated custom dialog that pops when pressing a button on the main dialog should display the output let's say as a string list.
What should I do to get that display ?
Thanks in advance for your help.
Frandy
  #2  
Old 27-Sep-2004, 08:48
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 961
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
Quote:
Originally Posted by Frandy
Hello:
I've created a dialog for a math C program, the output of which is stored in an array as double variables.
The associated custom dialog that pops when pressing a button on the main dialog should display the output let's say as a string list.
What should I do to get that display ?
Thanks in advance for your help.
Frandy

You can make a char[] out of a float like this:

CPP / C++ / C Code:
#include "conio.h"
#include "iostream.h"
#include "string.h"
#include "stdio.h"


char s[20];

int main(int argc, char* argv[])
{
	double a[20];
	
	for ( int i = 0; i < 20; i++ )
	{
		a[i] = (double) i + i;
	}
// char[] way
	sprintf(s, "%f", a[4]);
	cout << s << endl;
	getch();

	return 0;
}

Or, if you would rather use CStrings (as I do):

CPP / C++ / C Code:
// CString way
	CString cs;
	cs.Format("%f", a[4]);
	AfxMessageBox(cs);

You can display those in a list, or any kind of edit box you please...

Best regards,
Luci
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
 
 

Recent GIDBlogStupid Management Policies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dialog based application Frandy MS Visual C++ / MFC Forum 3 04-Oct-2004 00:55
How to let Enter-key-press message goes to ActiveX control on dialog Yuri MS Visual C++ / MFC Forum 3 08-Sep-2004 08:40
daialog based application MFC Pandiani MS Visual C++ / MFC Forum 2 01-Aug-2004 11:45
controling dialog objects & multiple source files omills MS Visual C++ / MFC Forum 0 15-Jul-2004 00:30

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 04:00.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.