openFileDialog - AccessViolationException was unhandled
-
Hi, Iam using Vs2015, While I try to Open a file using OpenFileDialog, Iam receiving the error "Unhandled exception of type" System.AccessViolationException" occoured in system.windows.forms.dll Additional information: Attempted to read or write protected memory.This is often an indication other memory is currupt. My Codes
System::Windows::Forms::OpenFileDialog^ MyFileOpenDialog = gcnew System::Windows::Forms::OpenFileDialog();
MyFileOpenDialog->Title = "Select Your Excel Test File";
MyFileOpenDialog->InitialDirectory = "C:\\";
MyFileOpenDialog->Filter = "Excel Files (*.xls)|*.xls|All files (*.*)|*.*";
MyFileOpenDialog->FilterIndex = 2;
MyFileOpenDialog->RestoreDirectory = true;
if (MyFileOpenDialog->ShowDialog() == System::Windows::Forms::DialogResult::OK) {
MyExcelFile = MyFileOpenDialog->FileName;
}I cannot understand my mistake ! Thanks For the helps!:thumbsup: Richard pls. advise me! Thank again !
-
Hi, Iam using Vs2015, While I try to Open a file using OpenFileDialog, Iam receiving the error "Unhandled exception of type" System.AccessViolationException" occoured in system.windows.forms.dll Additional information: Attempted to read or write protected memory.This is often an indication other memory is currupt. My Codes
System::Windows::Forms::OpenFileDialog^ MyFileOpenDialog = gcnew System::Windows::Forms::OpenFileDialog();
MyFileOpenDialog->Title = "Select Your Excel Test File";
MyFileOpenDialog->InitialDirectory = "C:\\";
MyFileOpenDialog->Filter = "Excel Files (*.xls)|*.xls|All files (*.*)|*.*";
MyFileOpenDialog->FilterIndex = 2;
MyFileOpenDialog->RestoreDirectory = true;
if (MyFileOpenDialog->ShowDialog() == System::Windows::Forms::DialogResult::OK) {
MyExcelFile = MyFileOpenDialog->FileName;
}I cannot understand my mistake ! Thanks For the helps!:thumbsup: Richard pls. advise me! Thank again !
Answered in CG Forum: [openFileDialog - AccessViolationException was unhandled](https://forums.codeguru.com/showthread.php?565616-openFileDialog-AccessViolationException-was-unhandled&p=2240072#post2240072)
-
Answered in CG Forum: [openFileDialog - AccessViolationException was unhandled](https://forums.codeguru.com/showthread.php?565616-openFileDialog-AccessViolationException-was-unhandled&p=2240072#post2240072)
Thank Victor:rose::thumbsup: