Click here to Skip to main content
15,919,121 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Newbie: Passing an object to a class Pin
AnsGe13-Sep-04 19:59
AnsGe13-Sep-04 19:59 
GeneralRe: Newbie: Passing an object to a class Pin
jblau14-Sep-04 3:10
jblau14-Sep-04 3:10 
GeneralNew Games Company Requires Programers Pin
KingsZone13-Sep-04 8:34
sussKingsZone13-Sep-04 8:34 
GeneralRe: New Games Company Requires Programers Pin
Christian Graus15-Sep-04 14:24
protectorChristian Graus15-Sep-04 14:24 
GeneralRe: New Games Company Requires Programers Pin
mayowa16-Sep-04 21:10
mayowa16-Sep-04 21:10 
GeneralNewbie: Create Events and EventHandlers Pin
jblau12-Sep-04 11:01
jblau12-Sep-04 11:01 
GeneralRe: Newbie: Create Events and EventHandlers Pin
Christian Graus15-Sep-04 15:11
protectorChristian Graus15-Sep-04 15:11 
GeneralReading file from OpenFileDialog. Pin
Link260010-Sep-04 13:05
Link260010-Sep-04 13:05 
<br />
private: System::Void menuOpenFile_Click(System::Object *  sender, System::EventArgs *  e)<br />
			 {<br />
				 StreamReader* InputStream;<br />
				 OpenFileDialog* openFileDialog1 = new OpenFileDialog();<br />
<br />
				 openFileDialog1->InitialDirectory = S"c:\\" ;<br />
				 openFileDialog1->Filter = S"txt files (*.txt)|*.txt|All files (*.*)|*.*" ;<br />
				 openFileDialog1->FilterIndex = 2 ;<br />
				 openFileDialog1->RestoreDirectory = true ;<br />
<br />
				 if(openFileDialog1->ShowDialog() == DialogResult::OK)<br />
				 {<br />
					 if((InputStream = openFileDialog1->OpenFile())!= 0)<br />
					 {<br />
						 // Insert code to read the stream here.<br />
						 txtBoxSource->Clear();<br />
						 <br />
<br />
<br />
						 String* lineOfText = InputStream->ReadLine();<br />
<br />
						 while(lineOfText != NULL)<br />
						 {<br />
							 txtBoxSource->Text = <br />
								 String::Concat(txtBoxSource->Text, lineOfText, S"\r\n");<br />
<br />
							 lineOfText = InputStream->ReadLine();<br />
<br />
						 }<br />
<br />
<br />
						 InputStream->Close();<br />
					 }<br />
				 }<br />
			}<br />
<br />



This program invoke a open file dialog. Now when I select a file
in the open file dialog, how do I read it? I used StreadReader,
but I got an error saying that it can't convert from System::IO.Stream
to System::IO.StreamReader.


I want to read the file and put it to the text box named txtBoxSource.



Thanks

-----------------------------
C++ without virtual functions is not OO. Programming with classes but without dynamic binding is called "object based", but not "object oriented".
GeneralRe: Reading file from OpenFileDialog. Pin
AnsGe14-Sep-04 4:44
AnsGe14-Sep-04 4:44 
Generalwondering for some help Pin
Anonymous10-Sep-04 4:26
Anonymous10-Sep-04 4:26 
GeneralRe: wondering for some help Pin
Christian Graus15-Sep-04 14:35
protectorChristian Graus15-Sep-04 14:35 
GeneralC# to managed C++ Pin
sreejith ss nair9-Sep-04 22:50
sreejith ss nair9-Sep-04 22:50 
GeneralRe: C# to managed C++ Pin
BAIJUMAX9-Sep-04 23:54
professionalBAIJUMAX9-Sep-04 23:54 
Generalaccess control in a derived class Pin
void()9-Sep-04 13:33
void()9-Sep-04 13:33 
GeneralAn unhandled exception has occurred in your application Pin
Waleed Eissa9-Sep-04 9:46
Waleed Eissa9-Sep-04 9:46 
Generalhelp!!!!! fork program Pin
nivsah7-Sep-04 14:33
nivsah7-Sep-04 14:33 
GeneralHELP!!I code due tomorrow Pin
benibo7-Sep-04 13:52
benibo7-Sep-04 13:52 
GeneralRe: HELP!!I code due tomorrow Pin
BAIJUMAX7-Sep-04 19:32
professionalBAIJUMAX7-Sep-04 19:32 
GeneralRe: HELP!!I code due tomorrow Pin
benibo12-Sep-04 10:35
benibo12-Sep-04 10:35 
GeneralRe: HELP!!I code due tomorrow Pin
BAIJUMAX12-Sep-04 19:35
professionalBAIJUMAX12-Sep-04 19:35 
GeneralRe: HELP!!I code due tomorrow Pin
benibo13-Sep-04 5:04
benibo13-Sep-04 5:04 
GeneralRe: HELP!!I code due tomorrow Pin
Christian Graus15-Sep-04 14:25
protectorChristian Graus15-Sep-04 14:25 
GeneralRe: HELP!!I code due tomorrow Pin
BAIJUMAX16-Sep-04 4:28
professionalBAIJUMAX16-Sep-04 4:28 
Question&amp;#12298;c++ template&amp;#12299;&amp;#65292;what means the following text? Pin
lzh086-Sep-04 17:20
lzh086-Sep-04 17:20 
AnswerRe: &amp;#12298;c++ template&amp;#12299;&amp;#65292;what means the following text? Pin
Christian Graus15-Sep-04 14:26
protectorChristian Graus15-Sep-04 14:26 

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.