PDA

View Full Version : Loading Dlls on demand or ( absolute )



zak
25-10-2009, 16:01
Hi
in this thread
http://community.thinbasic.com/index.php?topic=2912.msg22189#msg22189
Eros said "TBASS in thinBasic 1.7.10 uses a method to load DLL from memory instead that from file remapping all dll exported function."
in the error report file 700c_appcompat.rar which i had attached in that thread it mentions all the thinbasic modules even the program is just a one line (USES "TBASS")
is this means that thinbasic are loading all the modules to the memory waiting to be used by the (USES "moduleName")??, in many languages it is loading a specific module from hard disk upon request; as an example:
use Win32::GUI;

or this is just specific for TBASS module??

regards

Michael Hartlef
25-10-2009, 16:21
From what I saw it is TBass only atm.

ErosOlmi
25-10-2009, 16:28
Hi zak,

in that post I was talking about 3rd party dll dependancy

TBASS module is just a wrapping dll of the famous BASS sound library.
In order for TBASS to properly work, it needs BASS.DLL present somewhere.
So in the past when thinBasic encountered USES "TBASS" it loaded thinBasic_TBASS.DLL (the thinBasic module) and thinBasic_TBASS.DLL try to load BASS.DLL (the wrapped library) on the fly.

Now, to avoid to have 3rd party library around, in thinBasic beta I'm using a new way. BASS.DLL library is already embedded inside thinBasic_TBASS.DLL as resource and when thinBasic_TBASS.DLL module is loaded by thinBasic Core engine BASS.DLL is not loaded from disk but manually loaded in memory starting from a resource code and all exported function by BASS.DLL remapped on the fly. Mainly I'm doing manually what the operating system does automatically when a DLL is loaded from disk.
The big advantage is that a thinBasic module can be self contained even if it has 3rd party dependency dlls.

All is still very experimental. In all tests I did I was successful even in different OS. There are still few little bugs to fix and on which I'm working on.

Eros