IGxDialog hangs when on sub forms

328
3
07-04-2013 05:44 AM
Highlighted
New Contributor III
Hi, I have been tackling this error for days. I am in Arg10.0 Windows 7 using Engine. This all worked in 9.3, but now converting I have having some issues with accessing files. The following code works fine in the main form(I use 0 for the parentWindow), but it doesn't work on any sub forms. I have tried adding the IntPtr value, but same error "VSHOST.EXE has stopped working". it just hands trying to navigate to folders.

        Dim pGxDialog As IGxDialog
        Dim pSel As IEnumGxObject = Nothing
        Dim pGxobj As IGxObject = Nothing

        Dim Result(2) As String

        Try

            pGxDialog = New GxDialog
            pGxDialog.AllowMultiSelect = False
            pGxDialog.StartingLocation = "C:\"
            pGxDialog.Title = Title_Display
            pGxDialog.ObjectFilter = New GxFilterShapefiles


            Dim vptr As IntPtr
            vptr = Me.Handle


            'make sure something was selected
            If Not pGxDialog.DoModalOpen(pvtr.ToInt32, pSel) Then
                Exit Function
            End If


thanks
0 Kudos
3 Replies
Highlighted
Regular Contributor III
I don't anything about this function and don't program in VB.NET.

That said, it looks like you set up a variable named "vptr" but then pass one named "pvtr" to the function.

Implicit variable declaration is not one of the better features of VB.NET.
0 Kudos
Highlighted
New Contributor III
Yes, you are totally correct, that was bad on my part. I had been playing with other options in that variable, had tried the 0 again, so that was a typo. The program would've even built properly if that was the case.
I wish it was that easy. I think now there are more issues with converting 9.3 to 10.0 than just changing library references.

thanks,
0 Kudos
Highlighted
New Contributor III
Apparently, IGXDialog is not available in ArcEngine 10!!!! so if anyone has a work around, besides Window.forms dialog, please let me know.

thanks
0 Kudos