|
-
Feb 24th, 2005, 01:20 PM
#1
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?
-
Feb 24th, 2005, 01:36 PM
#2
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Feb 24th, 2005, 01:37 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|