Dynamic String Class - Hybrid COM Object
the object may be store/restored in any LONG
h = o.Ptr : o.Ptr = h
so, you can store the dynamic string object in a UDT
Hybrid COM Object:
- must allocate internal memory before using object; o.Alloc()
- must free allocated memory before object goes out of scope; o.Free()
object also needs to be initialized with an error handler before use;
local e as ErrT 'Error.inc
o.Initialize(e)
same error handler should be used for all hybrid objects.
This seems like a lot of trouble at first, but the "hybrid" concept allows
you to build lightweight class, list/trees/stacks, with millions if instances
and still use them as PB COM objects.
cal also be stored and passed as a Long.
Hybrid COM Object is basically like C++, New & Delete; except only the
internal UDT is allocated and freed - not the whole object.
all source and sample/test app: StringC.zip
public domain - use at your own risk
Note: you need to download source to compile
error and memory lib not posted
the object may be store/restored in any LONG
h = o.Ptr : o.Ptr = h
so, you can store the dynamic string object in a UDT
Hybrid COM Object:
- must allocate internal memory before using object; o.Alloc()
- must free allocated memory before object goes out of scope; o.Free()
object also needs to be initialized with an error handler before use;
local e as ErrT 'Error.inc
o.Initialize(e)
same error handler should be used for all hybrid objects.
This seems like a lot of trouble at first, but the "hybrid" concept allows
you to build lightweight class, list/trees/stacks, with millions if instances
and still use them as PB COM objects.
cal also be stored and passed as a Long.
Hybrid COM Object is basically like C++, New & Delete; except only the
internal UDT is allocated and freed - not the whole object.
all source and sample/test app: StringC.zip
public domain - use at your own risk
Note: you need to download source to compile
error and memory lib not posted
Comment