Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2003, 09:56 AM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Class_Terminate not firing

I have a form that is calling a method in a class module. This method then goes through and calles other methods inside this class module. I want to be able to exit the program at any time, however once inside the class module, I can click my exit button, set the variables to nothing and it will continue on processing as if nothing happened. Not sure what I am doing wrong.

 
Old July 14th, 2003, 10:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..
how are you doing that???

if you are inside a procedure (even in a class) and you press a button in your form,it doesnt trigger unless you have a do events..

even with that.. it will trigger the button and then go bakc to were it was ...

HTH...

Gonzalo Bianchi
 
Old July 14th, 2003, 10:14 AM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your reply.
I have doevents through out the code for items like the button that need to get fired. however when you click the exit button I want to exit the code, I click the button, inside the code I have the public variables set to nothing, which in my understanding means the class_terminate should fire, which it does not. It does go right back to the last place of execution, the point is I don't want it to do so I wish to end the program. I can use the ugly END to kill it but that is not the right way to do it, I am trying to find out how to kill it gracefully.

 
Old July 14th, 2003, 10:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

you cant finish a procedure even using do events if you try to kill it parent..
you will always stuck with this unless you use a flag on your class, that way when you cancel you turn this variable true and then you can wacth after the do event if the user cancel, then you cancel your procedure and can stop the process...

HTH...


Gonzalo Bianchi
 
Old July 14th, 2003, 11:13 AM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

that does help.
Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Events are not firing msrnivas .NET Web Services 14 April 21st, 2008 06:37 AM
Events not firing in IE malk ASP.NET 1.0 and 1.1 Professional 7 August 29th, 2006 01:32 PM
Firing Blanks... ozPATT Access VBA 11 January 20th, 2006 11:26 AM
Mysql not firing up ricbenson MySQL 1 February 6th, 2005 07:05 PM
DropDownList not firing pbyrum ASP.NET 1.0 and 1.1 Basics 7 October 12th, 2004 11:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.