Solved

OCX Raise Event

Posted on 2004-03-26
2
413 Views
Last Modified: 2013-11-13
I was wondering, How do you raise an event. Such as how the winsock Control has subs that get called. Winsock1_DataArrival.

How would I add a sub called "StartChange" to my OCX that the user can enter their code into and will be triggered.



-Brian
0
Comment
Question by:BrianGEFF719
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
Dabas earned 500 total points
ID: 10691039
Hi BrianGEFF719:
You declare your event at the top of your class

Public Event MyEvent1(Parameter1 As String, Parameter2 As Integer, ...)

When you want an event to occur within your program, you Raise the event

Public Sub MyProc
      RaiseEvent "hello", 5

Inside your calling module, you have to declare a variable as "With Events"

Dim WithEvents oMyClass as cMyClass

Dabas
0
 
LVL 19

Author Comment

by:BrianGEFF719
ID: 10691133
Thanks, let me try it out and get back to you.
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question