|
-
September 5th, 2011, 03:39 PM
#3
Re: Get path from openFileDialog
How do i do that?
This is what i was trying to do:
What is wrong with my code?
if(openFileDialog1->ShowDialog() == System::Windows::Forms: ialogResult::OK)
{
String^ path = System::IO::Path::GetDirectoryName(openFileDialog1->FileName);
fstream File;
File.open("c:\\path.txt", ios: ut);
if (File.is_open ())
{
for (int i = 0; i <= 50; i++)
File<< path[i] << endl;
}
File.close();
}
I get the error:
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in myapp.exe
Additional information: Index out of limits for the matrix
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|