[Gambas-user] Explicitly load a library
Benoît Minisini
gambas at ...1...
Wed May 31 12:10:31 CEST 2017
Le 29/05/2017 à 05:30, adamnt42 at ...626... a écrit :
> Is there any way to explicitly load a library similar to loading a
> component via Component.Load(name as String)?
>
> I want to load a library used by another project and determine the
> exposed classes in the library. It's for a code generator.
>
> So, my "target" project, say "AuctionCalendar" uses the
> "horse4.gambas" library. My code generator "GenCode2" interrogates
> the .project file for AuctionCalendar and can load any components it
> uses and determine the exposed classes therein. But I can't find a
> way to do the same for the horse4 library. Note, I can't use the
> source project for horse4 because it may not match the installed
> version, so I need to get the classes out of the executable archive.
>
Component.Load() can take an absolute path to a gambas executable to
load it as a library.
To just get information about a library file, look at the CLibraryInfo
class in the IDE source code.
For example, running 'gba3 -x <library path> .list' will return the
contents of the '.list' file included in the library executable, that
you can parse to get all the exported classes.
Regards,
--
Benoît Minisini
More information about the User
mailing list