Results 1 to 3 of 3

Thread: Unload Me alternative for a module

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Unload Me alternative for a module

    I have a module that has been compiled into an exe. This exe is then used by a DTS package to do some data transformations. When an error occurs in the transformation, an event is written to the applications error log. What I want to do now is if the error log grows to greater than 15KB, I want to exit the app. If I was using a form for this, I could us “Unload Me”. This obviously will not work for a module. The only way I know how to stop the execution within a module is to use the “End” keyword. There has got to be a better option than that.

    Any ideas?

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

    Re: Unload Me alternative for a module

    Since your not using any forms, are you using any classes? You could create a class to instanciate any
    objects. Then on that error call the class_terminate procedure to unload all your objects. Then do the "End".

    Also, you can use some APIs to watch the file size and when it reaches your desired size, close down correctly and then "End"?
    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

  3. #3
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: Unload Me alternative for a module

    “End” keyword. There has got to be a better option than that
    Sounds like you've bought into the "Never use End" tripe.
    There is nothing wrong with using END as long as you use it properly, especially in a situation like this.

    Now begins the religious war

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