Hi everyone
I have a VB2010 .Net program which maintains Supplier details. Each supplier has a certificate (PDF). The Supplier Maintenance program has a button which is intended to open a File dialog box, allow the user to select a PDF file and the program then stores the path and file name.
Private Sub but_Certificate_Path_Click(sender As System.Object, e As System.EventArgs) Handles but_Certificate_Path.Click
Dim ofd As New OpenFileDialog
ofd.Filter = "PDF Files(*.pdf)|*.pdf|All files (*.*)|*.*"
ofd.FilterIndex = 1
ofd.InitialDirectory = "\\xxx\BEE"
If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
txt_Bee_Certificate_Path.Text = ofd.FileName
End If
End Sub
When the 'Path' button is clicked the program crashes with :
AccessViolationException
Attempted to read or write protected memory.
This is often an indication that other memory is corrupt.
I am not using the OpenFileDialog1 control.
The Call Stack info that I am able to find is :
SupplierMaintenance.exe!SupplierMaintenance.frm_Supplier_Maint.but_Certificate_Path_Click(Object sender, System.EventArgs e) Line 415 Basic
user32.dll!766462fa()
[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]
user32.dll!76646d3a()
user32.dll!76646ce9()
ntdll.dll!76fd010a()
user32.dll!7664788a()
[External Code]
mscoreei.dll!6d0ef4f3()
KernelBase.dll!761c1e4b()
mscoree.dll!6de77efd()
mscoree.dll!6de77f16()
mscoree.dll!6de74de3()
kernel32.dll!760b336a()
ntdll.dll!76ff9f72()
ntdll.dll!76ff9f45()
Do I have a coding problem or a problem with user32.dll?
Does anyone know how I can resolve this - I am absolutely clueless.
Many thanks