Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Access violation writing location with dialog.ShowDialog()

$
0
0

I try to get the image path and display it with textbox,here is the code I use, but sometime it will get "Unhandled exception at 0x5bb76615 in FootballLineUp.exe: 0xC0000005: Access violation writing location 0x002b01bc." Nothing was catched. Anything hints on how to solve the problem? Thanks

Notes: OS: win7 sp1 64

try
            {
                OpenFileDialog dialog = new OpenFileDialog();
                dialog.Filter = "Images| *.png;*.jpg;*.jpeg;*.gif";
                dialog.InitialDirectory = @"C:\";
                dialog.Title = "Select image";
                dialog.ShowDialog();
                string filename = dialog.FileName;
                tb2_player_image_path.Text = filename;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

callstack messages:

 clr.dll!5bb76615()
 ntdll.dll!775562de()
 [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
 ntdll.dll!7753b652()
 ntdll.dll!7753b314()
 ntdll.dll!774f0133()
 ntdll.dll!774ffbca()
 ntdll.dll!774ffbca()
 KernelBase.dll!751fef1f()
 KernelBase.dll!751fefeb()
 [External Code]
>FootballLineUp.exe!FootballLineUp.MainWindow.bt2_choose_player_icon_Click(object sender, System.Windows.RoutedEventArgs e) + 0x9f bytesC#
 user32.dll!74e062fa()
 user32.dll!74e06d3a()
 user32.dll!74e06ce9()
 user32.dll!74e077c4()
 user32.dll!74e0788a()
 [External Code]
 mscoreei.dll!6e1855ab()
 mscoree.dll!6e1f7f16()
 mscoree.dll!6e1f4de3()
 kernel32.dll!758a33aa()
 ntdll.dll!77519ef2()
 ntdll.dll!77519ec5()


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>