You know the ID of each text box, right? And you have the HWND of the dialog box that contains the edit controls, right? Then use GetWindowText() for each box
char text[255]; // or however long the strings are
// hWnd is the HWND of the dialog box
HWND hEditWnd = GetDlgItem(hWnd,IDC_EDIT1);
// get 1st text box
GetWindowText(hEditWnd, text);
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Since it appears you are using managed (.NET) code, why not use the .NET classes for file IO? I'm no expert at C++/CLI but it might be as simple as:
System::IO::StreamWriter^ sw = gcnew StreamWriter("file.txt");
sw->WriteLine(txt1->Text);
GloriousEremite
Junior Poster in Training
65 posts since Jul 2006
Reputation Points: 108
Solved Threads: 14
That's because it doesn't go anywhere :)
Try this:
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e)
{
System::IO::StreamReader^ sr=gcnew StreamReader("C:\\Textol.txt");
Txt1->Text = sr->ReadLine();
sr->Close();
}
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
Practice makes perfect ;-)
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403