Results 1 to 4 of 4

Thread: Minimal example of module class

  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

  2. #2
    Junior Member
    Join Date
    Jun 2011
    Location
    Russia
    Posts
    18
    Rep Power
    15
    Thanks Petr.
    Can you do MSVC same or other minimal example for module class? Perhaps FreeBASIC?

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736
    Hi Maxim,

    I am sadly not familiar with C or FreeBASIC approach to create COM classes, maybe other guys will know better.
    I know that you can create classic modules (without classes) quite easily with FB, C (as seen in ThinBASIC/SDK samples), but the classes are new thing to the SDK, so no examples are present at the moment.


    Petr
    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

  4. #4
    Junior Member
    Join Date
    Jun 2011
    Location
    Russia
    Posts
    18
    Rep Power
    15
    Thanks Petr.
    One of the guys you advise?

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
  •