Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Initializing class modules

Posted on 1999-01-07
1
Medium Priority
?
162 Views
Last Modified: 2010-05-03
I am using VB4. I have created a simple class module and inserted it into my project. Later in my project, I use

  Dim x as new MyClass

How can I create an "Initialize" event for the class which will be called every time a new object of the class is created (in this case, x) ?


0
Comment
Question by:Sinclair
1 Comment
 
LVL 15

Accepted Solution

by:
ameba earned 200 total points
ID: 1454748
When class is instantiated, code in:
Private Sub Class_Initialize()
will execute (if any code is there)

So, put your init routines there.

Use Class_Terminate for your clenup code (freeing memory).
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

972 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