by AJ Hill (1 Submission)
Category: Object Oriented Programming (OOP)
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (5 Votes)
This is an example of how to use a "wrapper"
class to allow you to get access to the public
events of instanced objects from a module within
your program (instead of having to embed the
code within a form, which is bad practice).
Assumes
A few weeks ago I submitted a class to handle
buffering of outputs to increase efficiency of
write-to-file operations of a program I was
working on. The class worked just fine, but
I noticed that you couldn't get access to the
events of the class from a module (which then
prevents you from taking advantage of the
object's inbuilt limit detection.
This was a real nuisance, so I wrapped up the
code in a DLL which could then be linked to and
all worked fine... except for a point raised by
TerriTop - marshalling data to and from the DLL.
This project is my take on a work-around for
using the objects within the same project and
still experiencing the benefit of using their
events (from a module).
API Declarationsn/a
Download Class Event Wrapper (3 KB)