Results 1 to 7 of 7

Thread: [RESOLVED] How do i shut down all proesses in my form and unload it?

  1. #1

    Thread Starter
    Fanatic Member newprogram's Avatar
    Join Date
    Apr 2006
    Location
    in your basement
    Posts
    769

    Resolved [RESOLVED] How do i shut down all proesses in my form and unload it?

    My project has one form "form1" I'm using "unload me" to shut it down but there some proesses that keep run? Is "unload me" the right way to go?
    Live life to the fullest!!

  2. #2
    Lively Member djklocek's Avatar
    Join Date
    Aug 2006
    Posts
    107

    Re: How do i shut down all proesses in my form and unload it?

    Hello. If you mean loops, that don't end you should use boolean in insert it inside loop. For example when exit button is pushed, set this boolean to true and inside loop Do while .......(your statement) OR boolean = true. Sometimes there's a need to put it in many places, in this case breakpoints really help. If you don't have other chioce use End instead of Unload Me. This is the hard way to do it. Best regards

  3. #3
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: How do i shut down all proesses in my form and unload it?

    end = memory leaks <--- try to avoid it, it's like ending a process from the task manager. As djklocek says; a module level boolean is the way to go... Do until ThingyFinished Or StopAllLoopsNow (=True)
    One Boolean can serve all loops, it's not hard to implement.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How do i shut down all proesses in my form and unload it?

    What does your app do?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: How do i shut down all proesses in my form and unload it?

    The boolean in the loop is a good suggestion. I usually create a separate sub in a module to end the program, ie:

    vb Code:
    1. Public Sub EndProgram
    2.     'First destroy any public objects
    3.     'Unload forms
    4.     'In each form_unload make sure they stop all loops/timers, and destroy all objects.
    5.     Dim objForm As Form
    6.  
    7.     For each objForm in Forms
    8.         Unload objForm
    9.     Next
    10.  
    11.     set objForm = Nothing
    12. End Sub

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How do i shut down all proesses in my form and unload it?

    But she is only using a single form - Form1
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Fanatic Member newprogram's Avatar
    Join Date
    Apr 2006
    Location
    in your basement
    Posts
    769

    Re: How do i shut down all proesses in my form and unload it?

    Found It , It Was A Timmer. Thank You All
    Live life to the fullest!!

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