|
-
Sep 30th, 2000, 11:20 AM
#1
Thread Starter
Hyperactive Member
I'm making an activeX DLL in vb, and I want to terminate the class when they typed the wrong password.
How to?
Code:
Public Sub Class_Initialize()
If (CheckPassword) Then
'Everything is fine
Else
'Stop this class,
'When they want to use something of this class,
'it first has to be re-initialized.
End If
End Sub
-
Sep 30th, 2000, 11:31 AM
#2
Use Set MyClass = Nothing.
-
Sep 30th, 2000, 11:53 AM
#3
Thread Starter
Hyperactive Member
sorry
Sorry, didn't work:
"Variable not definied"
WP
-
Sep 30th, 2000, 11:58 AM
#4
Change MyClass to the variable you were using in place of your class.
Or you can remove Option Explicit from your project.
-
Sep 30th, 2000, 01:22 PM
#5
Thread Starter
Hyperactive Member
Didn't work
Not working, did you test it?
WP
-
Sep 30th, 2000, 02:43 PM
#6
Yes, it works for me.
Code:
Dim X As New Class1
'<--Do code there-->
Set X = Nothing
-
Oct 1st, 2000, 03:49 AM
#7
Thread Starter
Hyperactive Member
Ok, there was a misunderstanding. I have the following:
Project 1 (Type=ActiveX DLL)
-Class1
Project 2 (Type=Standard EXE)
-Just a form
(These projects are not in a group, they are seperated)
Code:
'Project 1
Public Sub CheckPassword(...)
If Password is correct then everything is fine
If Password is incorrect, this class has to be terminated
End Sub
'Project2
Dim MyFunctions As New Class1
Public Sub Cmd1_Click()
MyFunctions.CheckPassword(...)
End Sub
You see? I don't want to terminate that class in project2, I want to terminate it directly in the class.
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
|