473,473 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

a simple help pls???

actually,it is a very basic and simple question but i need to ask to
whom may know.i am a newbie in c++.NET 2003 and i am so embressed to
ask the question :oops: .
now,i have a output box that have some values written in it..and i
created a "save button".but i couldnt figured out how to say to save
the string(including values) in the outputbox?i mean yes it
works.when i press the button a save file dialog opens and i give a
name.but it does not save anything!how can i say it to save the data
in the outpubox?.i will give u the code of the button;

private: System::Void button1_Click_1(System::Object * sender,
System::EventArgs * e)
{
Stream* myStream ;

SaveFileDialog* saveFileDialog1 = new SaveFileDialog();

saveFileDialog1->Filter = S"txt files (*.txt)|*.txt" ;
saveFileDialog1->FilterIndex = 2 ;
saveFileDialog1->RestoreDirectory = true ;

if(saveFileDialog1->ShowDialog() == DialogResult::OK)
{
if((myStream = saveFileDialog1->OpenFile()) != 0)
{

myStream->Close();
}
}

}
where will i say to save the string in the output box.my outbox is
like;
degree 90 24.233 16
segment 12 11 12.447
degree 85 20.123 11
segment 10 17 10.212
..
..
..
but the saved file has nothing (since i dont know how to say to write
these outputext box values?).pls help me.

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Jul 21 '05 #1
4 1243
Look into the System.IO.TextWriter and System.IO.TextReader objects. They
are specialized Stream objects for text loading and writing. :)

HTH,
Lars-Erik

"den.NET" <de*****@walla-dot-com.no-spam.invalid> wrote in message
news:41**********@Usenet.com...
actually,it is a very basic and simple question but i need to ask to
whom may know.i am a newbie in c++.NET 2003 and i am so embressed to
ask the question :oops: .
now,i have a output box that have some values written in it..and i
created a "save button".but i couldnt figured out how to say to save
the string(including values) in the outputbox?i mean yes it
works.when i press the button a save file dialog opens and i give a
name.but it does not save anything!how can i say it to save the data
in the outpubox?.i will give u the code of the button;

private: System::Void button1_Click_1(System::Object * sender,
System::EventArgs * e)
{
Stream* myStream ;

SaveFileDialog* saveFileDialog1 = new SaveFileDialog();

saveFileDialog1->Filter = S"txt files (*.txt)|*.txt" ;
saveFileDialog1->FilterIndex = 2 ;
saveFileDialog1->RestoreDirectory = true ;

if(saveFileDialog1->ShowDialog() == DialogResult::OK)
{
if((myStream = saveFileDialog1->OpenFile()) != 0)
{

myStream->Close();
}
}

}
where will i say to save the string in the output box.my outbox is
like;
degree 90 24.233 16
segment 12 11 12.447
degree 85 20.123 11
segment 10 17 10.212
.
.
.
but the saved file has nothing (since i dont know how to say to write
these outputext box values?).pls help me.

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Jul 21 '05 #2
Cam
It doesn't look that you have actually written anything out!

Try this page for some sample code:
http://msdn.microsoft.com/library/de...TextToFile.asp
if(saveFileDialog1->ShowDialog() == DialogResult::OK)
{
if((myStream = saveFileDialog1->OpenFile()) != 0)
{

myStream->Close();
}
}


Jul 21 '05 #3
Cam
It doesn't look like you have actually written anything to the stream ...

Have a look at this page for some sample code
http://msdn.microsoft.com/library/de...TextToFile.asp

if(saveFileDialog1->ShowDialog() == DialogResult::OK)
{
if((myStream = saveFileDialog1->OpenFile()) != 0)
{

myStream->Close();
}
}


Jul 21 '05 #4
Cam
Oops! :)
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: delisonews | last post by:
I'm looking for a simple, filesystem-based message board. (No MySQL!) Something that I could include easily in my code: include '../inc/messageboard.php'; .... so that the board shows up at...
3
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
8
by: Dan | last post by:
Using XML::Simple in perl is extreemly slow to parse big XML files (can be up to 250M, taking ~1h). How can I increase my performance / reduce my memory usage? Is SAX the way forward?
6
by: Manuel Collado | last post by:
I would like to write simple, yet well structured documents with a really simple XML DTD (or schema). Either Docbook or SDocbook are overkill for this simple case. XHTML is simpler, but...
11
by: JKop | last post by:
Take the following simple function: unsigned long Plus5Percent(unsigned long input) { return ( input + input / 20 ); } Do yous ever consider the possibly more efficent:
4
by: Steven Blair | last post by:
I have the following number: 64521234567890 and need to apply some sort of simple encryption. Does c# have any classes for doing this. I cant use 3DES or anything as complex as. The size...
7
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
24
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to...
14
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
10
by: Phillip Taylor | last post by:
Hi guys, I'm looking to develop a simple web service in VB.NET but I'm having some trivial issues. In Visual Studio I create a web services project and change the asmx.vb file to this: Imports...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.