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
Solved

OCX Raise Event

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can we place a tooltip on the actual vb6 form 5 48
TT Auto Dashboard 13 95
Publisher:   Unknown     VB.exe Application 1 28
VBA: loop recent folder and copy txt file. 8 33
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

856 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