Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1448

VB6 A simple approach to Lighweight-Classes

$
0
0
As the title says already - another approach to LW-COM -
hopefully simple(r) to understand, because:
- it doesn't require to implement "all the Methods in the *.bas-Module"
- instead, method-implementation remains in the Class-CodeFile
- only the 3 Members of the IUnknown-interface will be swapped

On 32Bit, the minimal Class-Instance-size is only 8Bytes (half the size of a Variant).

Userdefined Private-Variables (when added to the two default-instance-members),
will increase the mem-usage from these 8Bytes obviously...
Performance (especially on instance-teardown) is as nice as one would expect from an lw-approach...

I've commented quite a bit, so there's more explanations in the code-modules.

Here's the Zip: SimpleLightWeightObjects.zip

Have fun,

Olaf
Attached Files

Viewing all articles
Browse latest Browse all 1448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>