Solved

VB .net  FileDialog.ShowDialog launches unrelated external program !?!

Posted on 2013-01-16
2
803 Views
Last Modified: 2013-01-17
Update: Narrowed it down some:
For some unfathomable reason, my system attempts to start an external program 'WRQ reflections' whenever a FileDialog.ShowDialog gets called.  There is absolutely no  reference in the project to reflections (an IBM Host session program).  (The crash referred to in the original post was happening in one of the reflections dlls.)  In disbelief I deleted the reflections folder from the 'Program Files' folder, and now the windows install launches and starts reinstalling reflections whenever showdialog gets called!  I created a new empty VB project & solution, with just one button that executes the following code, and sure enough 'openFileDialog1.ShowDialog' launches windows installer for reflections at the same time that the dialog appears.
.
Public Class Form1
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim openFileDialog1 As New OpenFileDialog()
        openFileDialog1.Title = "Test"
        openFileDialog1.ShowDialog() 'Windows installer fires up at same time that the dialog appears!
    End Sub
End Class

I'm utterly flummoxed!  Any ideas?

Original Post:
I'm debugging a VB .net application that queries data from a couple sources, (sql database tables, excel file), does some cross checking and creates a DataTable listing discrepancies, and saves the datatable as an xml file after having the user select a file to save it to.  
The strange part is that it appears to execute all the querying and data table creation fine, but crashes with 'vshost32-clr2.exe has stopped working' immediately after executing the line 'If saveFileDialog1.ShowDialog() = DialogResult.OK Then'.  That is, the dialog is displayed, but the crash occurs immediately afterwards without any user input.
Windows 7 Pro Service Pack 1 64 bit, Visual Studion 2010 SP1, running a debug build within visual studio.

I would be most grateful for any suggestions on possible causes or how to attempt to identify them.


    Public Sub ExportData()
        ' Create a data table with the appropriate columns.
        Dim Table As DataTable = New DataTable("Export")
        'Add the sku column
        Table.Columns.Add("SKU")
        'Add all other selected columns
        For Each ItemIdx As LookedUpDataItems In [Enum].GetValues(GetType(LookedUpDataItems))
            For Each SourceIdx As DataSourceIndicesEnumeration In SettingsDialog.GetSelectedSourceIndices(ItemIdx)
                If (SourceIdx = DataSourceIndicesEnumeration.ManualOverride) Then
                    Continue For
                End If
                Dim z As String = [Enum].GetName(GetType(LookedUpDataItems), ItemIdx) & "_" & [Enum].GetName(GetType(DataSourceIndicesEnumeration), SourceIdx)
                Table.Columns.Add(z)
                If (SourceIdx = DataSourceIndicesEnumeration.Pkg) Then
                    Table.Columns.Add(z & "Confidence")
                End If
            Next
            Table.Columns.Add([Enum].GetName(GetType(LookedUpDataItems), ItemIdx) & "_Status")
        Next

        For Each o As OrderInfoClass In Orders
            Dim row As DataRow = Table.NewRow()
            LoadExportDataRow(row, o)
            Table.Rows.Add(row)
        Next
        Dim saveFileDialog1 As New SaveFileDialog()
        saveFileDialog1.Title = "Save discrepancy table as..."
        saveFileDialog1.Filter = "xml files (*.xml)|*.xml"
        saveFileDialog1.FilterIndex = 1
        saveFileDialog1.RestoreDirectory = True
        If saveFileDialog1.ShowDialog() = DialogResult.OK Then  '********Crashes immediately after showing the dialog.  *******
            Dim myStream As Stream
            myStream = saveFileDialog1.OpenFile()
            If (myStream IsNot Nothing) Then
                Table.WriteXml(myStream)
                myStream.Close()
            End If
        End If
        MessageBox.Show("To view the discrepancy table, open the xml file with Excel.  When prompted for how to open it, select 'as an XML list'.", "XML File Viewing Notes:")
    End Sub
0
Comment
Question by:dcShaver
2 Comments
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 500 total points
ID: 38787310
Hi,

Seems like some references still with the registry!

So try cleaning it using some third party utilities to clean registry entries like CCleaner etc.,

http://www.piriform.com/ccleaner

Hope it helps u...
0
 

Author Closing Comment

by:dcShaver
ID: 38788416
A proper uninstall of reflections fixed it, presumably by removing the registry references.  
Apparently there were similar issues with reflections causing crashes when dialogs were opened in office applications, so IT is in the process of replacing reflections.
Thank you,
0

Featured Post

Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Maros for passwords? 5 30
Asp.Net Session Question 2 33
Sharepoint 2016 LDAP connection 22 19
How do audio drivers work? 4 41
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question