Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 12
  1. #1

    [VB 6] Scaricare Programma

    Ciao ho un programma che una volta terminato riceve il comando Unload Me, ma mi si chiude solamente il form e non l' intero programma.

    Inoltre nel Unload e Query Unload di questo form ho messo:

    codice:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        If (AS400Rs.State = adStateOpen) Then
            AS400Rs.Close
        End If
        If (AS400Cn.State = adStateOpen) Then
            AS400Cn.Close
        End If
        Unload Me
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        If (AS400Rs.State = adStateOpen) Then
            AS400Rs.Close
        End If
        If (AS400Cn.State = adStateOpen) Then
            AS400Cn.Close
        End If
        Unload Me
    End Sub
    Se metto Kill me non succede niente.
    Come mai?

  2. #2
    perchè è sbagliatissimo mettere un unload me nella routine di unload così diventa ricorsiva
    al posto di unload me metti set nomeform = nothing nell' evento unload
    Vascello fantasma dei mentecatti nonchè baronetto della scara corona alcolica, piccolo spuccello di pezza dislessico e ubriaco- Colui che ha modificato l'orribile scritta - Gran Evacuatore Mentecatto - Tristo Mietitore Mentecatto chi usa uTonter danneggia anche te

  3. #3
    Ah non lo sapevo xe, come sono ignorante!!


  4. #4
    Niente ho fatto cosi'
    codice:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    On Error GoTo Err_QueryUnload
        If (AS400Rs.State = adStateOpen) Then
            AS400Rs.Close
        End If
        If (AS400Cn.State = adStateOpen) Then
            AS400Cn.Close
        End If
    Exit_QueryUnload:
        Exit Sub
    Err_QueryUnload:
        WriteLog ("QUERYUNLOAD" & err.Number & "   " & err.Description)
        Resume Next
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
    On Error GoTo Err_Form_Unload
        If (AS400Rs.State = adStateOpen) Then
            AS400Rs.Close
        End If
        If (AS400Cn.State = adStateOpen) Then
            AS400Cn.Close
        End If
        Set AS400Rs = Nothing
        Set AS400Cn = Nothing
        Set frmAvvio = Nothing
    Exit_Form_Unload:
        Exit Sub
    Err_Form_Unload:
        WriteLog ("FORMUNLOAD" & err.Number & "   " & err.Description)
        Resume Next
    End Sub
    Ma non me lo scarica ...

  5. #5
    Risolto !!

    Avevo un obj che poi non settavo = Nothing e quindi rimaneva caricato e il programma non riusciva a scaricarlo ...


  6. #6
    No adesso non mi si scarica di nuovo? COsa puo' essere?

  7. #7
    a che serve un resume next come ultima istruzione?
    writelog fa riferimento a qualche oggetto?
    ma
    codice:
    Exit_QueryUnload:
        Exit Sub
    a che serve fare una label?
    Vascello fantasma dei mentecatti nonchè baronetto della scara corona alcolica, piccolo spuccello di pezza dislessico e ubriaco- Colui che ha modificato l'orribile scritta - Gran Evacuatore Mentecatto - Tristo Mietitore Mentecatto chi usa uTonter danneggia anche te

  8. #8
    Guarda adesso ho fatto csi'

    codice:
    Private Sub Form_Unload(Cancel As Integer)
    On Error GoTo Err_Form_Unload
        If (AS400Rs.State = adStateOpen) Then
            AS400Rs.Close
        End If
        If (AS400Cn.State = adStateOpen) Then
            AS400Cn.Close
        End If
        Set AS400Rs = Nothing
        Set AS400Cn = Nothing
        Set frmAvvio = Nothing
    Exit_Form_Unload:
        Exit Sub
    Err_Form_Unload:
        WriteLog ("FORMUNLOAD" & err.Number & "   " & err.Description)
        Resume Next
    End Sub
    mentre writeLog usa oggetti che pero' si svuotano a fine procedura ...
    Ho eliminato queryUnload

  9. #9
    codice:
    Private Sub Form_Unload(Cancel As Integer)
    On Error GoTo Err_Form_Unload
        If (AS400Rs.State = adStateOpen) Then
            AS400Rs.Close
        End If
        If (AS400Cn.State = adStateOpen) Then
            AS400Cn.Close
        End If
        Set AS400Rs = Nothing
        Set AS400Cn = Nothing
        Set frmAvvio = Nothing
    
        Exit Sub
    Err_Form_Unload:
        call WriteLog ("FORMUNLOAD" & err.Number & "   " & err.Description)
    End Sub
    prova così
    Vascello fantasma dei mentecatti nonchè baronetto della scara corona alcolica, piccolo spuccello di pezza dislessico e ubriaco- Colui che ha modificato l'orribile scritta - Gran Evacuatore Mentecatto - Tristo Mietitore Mentecatto chi usa uTonter danneggia anche te

  10. #10
    no ho tolto proprio la label ma nada ...

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.