Click here to Skip to main content
15,887,442 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
*** Removed all designer boiler plate code. It has nothing to do with the problem. ***
C++
private: System::Void executeButton_Click(System::Object^  sender, System::EventArgs^  e)
{
    ifstream myInfile ("ReadText.txt");
    ofstream myOutfile ("SaveText.txt");

    if (myInfile.is_open())
    {
        do
        {
            char chOne;
            myInfile.get(chOne);

                // I want to manipulate the input here, which I'm unable to do using stream.

            myOutfile.put(chOne);
        } while (!myInfile.eof());

        myInfile.close();
        myOutfile.close();
        Form1::~Form1();
    }
    else
    {
        Form1::~Form1();
    }															
}


[edit]
Added from OP different question:
Just so you know, all I want to do is input file names into two text boxes(System String), and assign them to my ifstream and ofstream. I've tried string conversion and Marshal. All I get are Elem Trait errors and some kind of misdirection errors.
[/edit]
Posted
Updated 30-Jan-16 5:13am
v4
Comments
Mehdi Gholam 30-Jan-16 9:54am    
2 years on a problem... it must not be important!
[no name] 30-Jan-16 10:51am    
Ohhhh, there are many Problems in this world older than two years which are very important to solve but do not have a solution today.... including some (all) web technologies :-)
OriginalGriff 30-Jan-16 10:35am    
If you have been trying for two years, then you must have tried a lot of things.
So tell us what you have tried.
Tell us what happened, what your problem is.
Just dumping code here and going "it don't work" - which is effectively what you've done - doesn't really help anyone.
Use the "Improve Question" widget to give us better information, please.
[no name] 30-Jan-16 10:45am    
Please give some more Information where you stuck exactly. Nobody here is keen on to view your code in details and trying to speculate where the problem is.
[no name] 30-Jan-16 11:14am    
"Form1::~Form1()" very interesting... I Need to try this first.

1 solution

Don't use the C methods of manipulating files. Use the .NET System.IO classes instead.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900