Petr Schreiber
03-07-2011, 11:46
As the ThinBASIC 1.8.8.0 introduced the module class concept, and some users start to experiment with it, I attach here very simple example of module exposing class.
The PowerBASIC module code, contained in thinBasic_Vector3D.bas, defines the Vector3D class with constructor, destructor and single "normal" method, called ToString
The ThinBASIC test code, represented by thinBasic_Vector3D_Test.tBasic, shows how to instantiate and use the created object
It is very simple project just to demonstrate few important steps in module class creation:
creating internal COM representation
creating visible interface to it via thinBasic_Class* SDK functions
creating wrapper functions/subs for methods, taking care of instantiation, release and parameter parsing (same as in normal modules)
Petr
The PowerBASIC module code, contained in thinBasic_Vector3D.bas, defines the Vector3D class with constructor, destructor and single "normal" method, called ToString
The ThinBASIC test code, represented by thinBasic_Vector3D_Test.tBasic, shows how to instantiate and use the created object
It is very simple project just to demonstrate few important steps in module class creation:
creating internal COM representation
creating visible interface to it via thinBasic_Class* SDK functions
creating wrapper functions/subs for methods, taking care of instantiation, release and parameter parsing (same as in normal modules)
Petr