|
-
Aug 21st, 2000, 03:37 AM
#1
Thread Starter
Fanatic Member
I need to do a RaiseEvent for one of the Class modules in this project I'm working on. The catch is the the class shows a form, and the form needs to interact with the program that called the dll. I'd like to do this through events, but I can't seem to figure out how to RaiseEvent from the form. (BTW, there are several forms and several class modules in the DLL project)
I was thinking that I might need to use a Friend sub to do this. Anybody know if that would work, or a better way to RaiseEvent from a form?
-
Aug 21st, 2000, 03:44 AM
#2
transcendental analytic
You use Raisevent in the Class that raises the event, not the form.
You declare an event in your class:
Code:
Public Event Yourevent
then you raise the event in your class
Code:
Raisevent Yourevent
You declare the class in your form:
Code:
Public withevents yourobj as yourclass
Then you can select your object from the object list combo and you have the event
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 21st, 2000, 03:56 AM
#3
Thread Starter
Fanatic Member
God damn, that was a fast reply!!! Not what i'm looking for. The dll that's calling the class uses the Dim withevents thing. When the classes form is show, it has a button on it. When that button is clicked, i want the class object to send the Click event back to the program that's calling the AcitveX dll.
-
Aug 21st, 2000, 04:08 AM
#4
Hyperactive Member
Then define the event in the form eg.
Event ButtonClicked
and call it when the button is clicked:
RaiseEevent ButtonClicked
You need to make sure you dim the form in the class with WithEvents, then you should see the form in the object-dropdown box (left dropdown box), and the event in the right dropdownbox inthe code editor. Basically it works the same as with classes (since a form is a class).
Oh I assume you know that when you dim the form withevents, you need to Set fFormVar = New MyForm and also call that fFormVar.Show
-
Aug 21st, 2000, 04:17 PM
#5
Thread Starter
Fanatic Member
You're a ****ing genius!!! This look like it should work. I'll post any problems I have with it to this thread.
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
|