NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Teststand lock when calling vb.net OpenFileDialog.ShowDialog

Hey

 

Im trying to use a vb.net OpenFileDialog to let the use select a file.

For example teststand calls the following vb.net function from a Pass/Fail Test step:

 

Public Function testfunk() As Boolean
       Dim fldg As New Windows.Forms.OpenFileDialog
       fldg.Title = "Select File"
       fldg.Filter = "(.bin)|*.bin"

       If fldg.ShowDialog = Windows.Forms.DialogResult.OK Then
           Return True
       Else
         Return False
       End If
End Function

 

The problem im having is that teststand locks at fldg.showdialog without showing the dialog, the only way to stop the executeing is to kill the thread.

 

I have scaled the problem down somewhat here just to show exactly where the problem is, when i get this part working im going to save the filepath in vb and use it for some other functions.

 

All help is appreciated.

0 Kudos
Message 1 of 3
(3,886 Views)

Are you sure the dialog isn't just being shown behind the sequence editor window? It's probably not going to be modal to the sequence editor because it's being displayed in a different thread. You can use Engine.NotifyStartOfModalDialogEx and Engine.NotifyEndOfModalDialog, to make the dialog modal if needed.

 

-Doug

0 Kudos
Message 2 of 3
(3,864 Views)

Thnx.

I will give this a try when i get the time.

0 Kudos
Message 3 of 3
(3,858 Views)