Results 1 to 9 of 9

Thread: Creating Oxygen DLLs using thinBasic

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Creating Oxygen DLLs using thinBasic

    OxygenBasic can be used to create general-use DLLs. You can also test them at the same time within the envelope of a single thinBasic script.

    To create independent DLLs, a run-time library source needs to be embedded. I have included RTL32 with the latest thinBasic_Oxygen here in examples/DLL/

    http://www.thinbasic.com/community/s...ad.php?t=12175

    To expose any function, all you need to do is add export to its prototype.

    The code for terminating the DLL (before the DLL is unloaded) is automatically generated.

    Hello World Example
    uses "oxygen"
    
    
    dim src as string
    
    
    src="
    
    
    %       filename "t.dll"
    %       dll
    include "RTL32.inc"
    
    
    function hello(byval name as string) as string, export
      return "Hello "+name
    end function
    
    
    " 'end src
    
    
    o2_basic src
    if o2_errno then
      msgbox 0, o2_error
      stop
    else
      o2_exec
    end if
    
    'TEST
    
    
    declare function hello lib "t.dll" alias "hello" (byval name as string) as string
    
    
    msgbox 0,hello("World!")
    
    Last edited by Charles Pegge; 31-12-2013 at 13:19.

Similar Threads

  1. Creating PDF file from ThinBASIC
    By Petr Schreiber in forum Files and directories handling
    Replies: 6
    Last Post: 30-08-2020, 14:56
  2. Creating thinBasic keywords lists
    By ErosOlmi in forum Tips and Tricks
    Replies: 13
    Last Post: 29-12-2012, 03:45
  3. Replies: 12
    Last Post: 13-06-2009, 22:00
  4. Creating .exe from thinbasic scripts
    By Macros The Black in forum thinBundle
    Replies: 1
    Last Post: 02-06-2009, 09:36
  5. TOMDK - creating TB modules with Oxygen
    By Charles Pegge in forum Legacy
    Replies: 6
    Last Post: 21-08-2008, 06:31

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
  •