Reputation: 21
I made a program in vb.net 2013 . and it's running fine on my computer windows 7
when i did setup for program on the other computer . everything works fine except
when i try to open a file to select a picture .once i click open button the program freezes for a minute then it throws exception :
Problem signature: Problem Event Name: BEX Application Name:: BaldEagle.exe Application Version: 1.0.0.0 Application Timestamp: 55b3c11d Fault Module Name: StackHash_0a9e Fault Module Version: 0.0.0.0 Fault Module Timestamp: 00000000 Exception Offset: c176c13f Exception Code: c0000005 Exception Data: 00000008 OS Version: 6.1.7600.2.0.0.768.3 Locale ID: 1033 Additional Information 1 0a9e Additional Information 2 0a9e372d3b4ad19135b953a78882e789 Additional Information 3 0a9e Additional Information 4 0a9e372d3b4ad19135b953a78882e789
Privacy policy on the internet: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0401
The code of opening a file to select a picture :
Dim ofd As New OpenFileDialog
ofd.Filter = "Text Files (*.jpg)|*.jpg|PNG(*.png)|*.png|gif(*.gif)|*.gif|JPEG(*.jpeg)|*.jpeg"
ofd.InitialDirectory = "c:\"
If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim bmp As New Bitmap(ofd.FileName)
If bmp.Width.ToString = "300" And bmp.Height.ToString = "300" Then
' MsgBox("Cool")
Else
MsgBox("must be 300×300")
Exit Sub
End If
If Application.StartupPath & "\set\logo.png" = ofd.FileName Then
MsgBox("this is actually your ccurrent logo", MsgBoxStyle.Critical)
Exit Sub
End If
If MsgBox("do you want to change logo ?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If My.Computer.FileSystem.FileExists(Application.StartupPath & "\set\logo.png") = True Then
My.Computer.FileSystem.DeleteFile(Application.StartupPath & "\set\logo.png")
End If
My.Computer.FileSystem.CopyFile(ofd.FileName, Application.StartupPath & "\set\logo.png")
End If
End If
Upvotes: 1
Views: 4592
Reputation: 8004
The StackHash error occurs when DEP (Data Execution Prevention) is invoked and has an issue with the application you’re trying to run. Note: I have tried your code and it work's just fine on my machine.
Please see if these steps help to fix the issue...
More on this issue here.
Upvotes: 1