|
-
Jul 8th, 2010, 03:13 PM
#1
Thread Starter
Lively Member
[RESOLVED] Form hangs under Vista 64 bits
Hi:
I have detected a problem running my application under Vista 64 bits OS.
My application is developed using VB.NT 2008 and compiled as x86
I have a main form. In this form there is an option to open other form. TThis second form must return a few values to the main form. When the user click on this 2nd form, to return values, this form hangs up (2nd form hangs up)
But for what I could have known, it continues executing the rest of code that exists after to open form. I want to say that the form dialog (2nd form) is not closed (hangs up) but it the code continues being executed, because I have seen that inserts the data in the database.
The application not returns any error and any exception.
frmWaiting (form displayed when call thread)
Code:
This forms contains progressbar
main form
Code:
Dim ThreadVentas As System.Threading.Thread
Private Sub ClosePb()
Try
If Me.InvokeRequired Then
Me.Invoke(New ClosePbDelegate(AddressOf ClosePb))
Else
If Not frmPb Is Nothing Then
frmPb.Close()
frmPb = Nothing
End If
Me.loadData(condicio, condicio2)
End If
Catch ex As Exception
End Try
End Sub
Private Sub btGenDocVtas_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs)
Try
ThreadVentas = New System.Threading.Thread(AddressOf savedata)
ThreadVentas.Start()
frmPb = New frmWaiting
frmPb.ShowDialog()
Me.cmbBase.Focus()
Catch ex As Exception
gSaveError(Me.Name, ex.ToString)
End Try
End Sub
private sub SaveData()
Dim f As New frmxxxx
Try
If f.ShowDialog = Windows.Forms.DialogResult.OK Then
serie = f.f_serie
doc = f.fdoc
Else
If Not f Is Nothing Then
f.Dispose()
f = Nothing
End If
Exit Sub
End If
Catch ex As Exception
gSaveError(Me.Name, ex.ToString)
Finally
If Not f Is Nothing Then
f.Dispose()
f = Nothing
End If
End Try
'From here there are code to insert data in the database
......
.....
End Sub
frmXXXX (2nd form)
Code:
Dim dtseries As DataTable
-------
Public ReadOnly Property fserie() As String
Get
Return Me.cmbDocVtas.SelectedItem
End Get
End Property
Public ReadOnly Property fdoc() As Boolean
Get
Return Me.chkAp.Checked
End Get
End Property
Private Sub frmXXXX_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Me.dtseries = Nothing
End Sub
Private Sub btOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btOk.Click
Me.DialogResult = DialogResult.OK
End Sub
There is something that and it works differently in systems of 64 bits? There is incorrect code? on other computers it works well,
Regards
Last edited by yaeko; Jul 9th, 2010 at 04:09 AM.
-
Jul 8th, 2010, 03:52 PM
#2
Re: Form hangs under Vista 64 bits
have you tried setting breakpoints and stepping through the code to see where it's going and what it's doing?
-tg
-
Jul 8th, 2010, 03:55 PM
#3
Re: Form hangs under Vista 64 bits
Are you making any Cross Thread calls? Like, is SaveData() being called on a thread that's not the UI thread?
-
Jul 9th, 2010, 04:02 AM
#4
Thread Starter
Lively Member
Re: Form hangs under Vista 64 bits
 Originally Posted by techgnome
have you tried setting breakpoints and stepping through the code to see where it's going and what it's doing?
-tg
this ocurrens on PC's customer. I can not install VS there
but i control exceptions and not returns any error and any advice
Are you making any Cross Thread calls? Like, is SaveData() being called on a thread that's not the UI thread?
Yes.
I have updated my 1st post to show thread call. User click btGenDocVtas button to start process
But I am using similar threads and runs fine. Except this.
Last edited by yaeko; Jul 9th, 2010 at 04:13 AM.
-
Jul 9th, 2010, 11:08 AM
#5
Thread Starter
Lively Member
Re: Form hangs under Vista 64 bits
I have found the problem following the comments of the user formlesstree4
The problem was thread.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|