Solved

OCX Raise Event

Posted on 2004-03-26
2
406 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now