Gang,
I am so confused by all the descriptions of different Visual C++ stuff, API, MFC, I don't even know how to tell you what I am trying to use - other than:

I created a Windows Form Application using Visual C++ 2005 Express Edition.

I have a textBox1 which is populated by OpenFileDialog, which is to be the input file.

I have a textBox2 which is textBox1 with a different extension on the filename, and a button.

When I press the button I want to:
get a filename from OpenFileDialog and put the name in textBox1 // Works fine
modify that in textBox1 into textBox2 //Works fine

open the file in textBox1 to read the text in the file // stumpted

read text into a string or char variable // stumpted

write text from a string or char variable to the output file listed in textBox2
// if I could do above I could probably figure it out.


Thanks for all help.

Lee

open the file in textBox1 to read the text in the file // stumpted

read text into a string or char variable // stumpted

Which is why I would recommend you learn about standard C/C++ before trying to do nonstandard stuff like Windows, unless this is part of a class and they are forcing you to do this.

Windows has it's own file read/write commands, that are probably wrappers for the C/C++ syntax, though I don't know that for sure. Either way, if you know how to do these things in C/C++ it's a whole lot easier to see how to do these tasks once you try to port to Windows.

If you must do this in Windows at this time, then look into function like GetDlgItemText() which gets the text "item" in an edit box, or other Dialog window, and stores it in the C style string passed as the second parameter to the function-----I think anyway.

If you are using visual studio, the MSDN site has a complete reference to functions you will need. I suggest you get to know the MSDN site (it can be a bit tough to begin with).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.