Results 1 to 5 of 5

Thread: [RESOLVED] Form hangs under Vista 64 bits

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2009
    Posts
    73

    Resolved [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.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #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?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2009
    Posts
    73

    Re: Form hangs under Vista 64 bits

    Quote Originally Posted by techgnome View Post
    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2009
    Posts
    73

    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
  •  



Click Here to Expand Forum to Full Width