Results 1 to 4 of 4

Thread: Minimal example of module class

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Lightbulb Minimal example of module class

    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
    Attached Files Attached Files
    Last edited by Petr Schreiber; 03-07-2011 at 11:48.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •