Author Topic: PlugIn system for Oxygen basic  (Read 12753 times)

0 Members and 2 Guests are viewing this topic.

Aurel

  • Guest
Re: PlugIn system for Oxygen basic
« Reply #30 on: March 26, 2013, 02:59:05 PM »
Hi...
try this:
Code: [Select]
$ filename "leyer.exe"
include "RTL32.inc"
include "MinWin.inc"

of course your program leyer.o2bas must be in same folder where you create exe.
i have this in main oxygen folder with minwin.inc and rtl32.inc

and compile OK, after compile i run program and get messagebox with 0
is this ok?

Charles Pegge

  • Guest
Re: PlugIn system for Oxygen basic
« Reply #31 on: March 27, 2013, 01:55:12 AM »

Quote
each one will process the source code as it want then next one and so on...

This is reminiscent of the LLVM tool chain.

LLVM (low level virtual machine) gained prominence when it was adopted by Apple for their Objective C compiler.

Compilation is split down into a series of accessible configuarable layers.

llvm.org/

Charles Pegge

  • Guest
Re: PlugIn system for Oxygen basic
« Reply #32 on: March 27, 2013, 02:47:03 AM »
There is a file listing program examples/FileFuncs.o2bas, which you could adapt to your requirements.

It will support an unlimited list of files: I've cleaned it up a little here:


  $ filename "t.exe"
  '#include "../../inc/RTL32.inc"
  '#include "../../inc/RTL64.inc"
  #include "../../inc/MinWin.inc"
  #include "../../inc/FileDir.inc"

  '====
  'TEST
  '====

  zstring dirname[256]
  string filter="*.o2bas"
  string cr=chr(13,10)
  sys count
  
  '
  GetCurrentDirectory 256, @dirname
  string pr="Directory Name: " dirname cr "Filter: " filter cr cr
  pr+=GetFileList (filter,count) cr cr
  print pr count " files"
« Last Edit: March 27, 2013, 02:54:33 AM by Charles Pegge »

Emil_halim

  • Guest
Re: PlugIn system for Oxygen basic
« Reply #33 on: March 27, 2013, 07:58:33 AM »
thanks you Aurel , Charles very much.

but i wonder what is the deffrence between those
Quote
 $filename "t.exe"
  and
  $ filename "t.exe"

also i have an other problem , see this , the dll function did not called at all !!!!!!!!!!??????
Code: [Select]



  $ filename "Test.exe"
  #include "..\..\inc\RTL32.inc"
  #include "../../inc/MinWin.inc"
  
' find layer folder
'==================

bool FindLayerFolder ()
{
    WIN32_FIND_DATA f
    sys h = FindFirstFile("Layer", @f)
    if h and f.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY then return true
    return false  
}

' get files in layer folder
'==========================

int    LayerNo = 0
string LayName[20]

sub GetLayers()
    WIN32_FIND_DATA f
    sys h , e
    h = FindFirstFile("Layer/*.dll", @f)
    if h then
      do
         LayerNo++  
         LayName[LayerNo] = f.cFileName
         e=FindNextFile( h, @f )
         if e = 0 then exit do
      end do
      FindClose( h )    
    end if
end sub

' load all layers
'================
dword LayerHandle[20]
dword procStart[20]
dword procProcess[20]
dword procEnd[20]

sub LoadLayers()
    sys i
    for i = 1 to  LayerNo
       LayerHandle[i] = LoadLibrary( LayName[i] )
       procStart[i]   = GetProcAddress(LayerHandle[i],"StartLayer")
       call procStart[i]
       procProcess[i] = GetProcAddress(LayerHandle[i],"ProcessLayer")
       procEnd[i]     = GetProcAddress(LayerHandle[i],"EndLayer")
    next
End sub

' free all layers
'================
sub FreeLayers()
    for i = 1 to  LayerNo
      call procEnd[i]
      FreeLibrary(LayerHandle[i])
    next
end sub

sys i
print FindLayerFolder

if FindLayerFolder() then
   GetLayers()
   for i = 1 to  LayerNo
       print  LayName[i]
   next
end if        
  
LoadLayers()


FreeLayers()  

and here is a test layer put it in a folder and name it a Layre

Code: [Select]

  '
  ' Layere define Example
  '
  
  $ dll
  $ filename "define.dll"
  #include "..\..\..\inc\RTL32.inc"


  ' start function
  '===============
  sub StartLayer(), export
      print "from Define start function layer"
  end sub
  
  'process function
  '================
  function ProcessLayer(string* src) as bool , export
       print "from Define process function layer"
  end function
  
  'End function
  '============
  sub EndLayer() , export
       print "from Define end function layer"
  end sub

« Last Edit: March 27, 2013, 08:05:36 AM by Emil_halim »