External Libraries and Objects
Previous Top Next

As of version 4.00 Basic4ppc supports working with external libraries.
The external libraries are dll files which include all kinds of new functionality.
There are three stages for working with external libraries:
First Stage:
Open the Components dialog using Tools - Components...

The Components dialog shows the dll and code files that are used for the desktop and the device. Sometimes there are different files for the desktop and the device (like SerialDevice.dll and SerialDesktop.dll).

Add the required dll file.
Second Stage:
Using Tools - Add Object, choose the object type and create an object of this type.

If you prefer to add the objects at runtime you can use the AddObject keyword instead.

Third Stage:
Before using an object it must first be initialized with one if its New methods.

Important notes:
Under the Help menu you will find the documentation of all the libraries (on the desktop only).
Like all other controls, when you write the object's name and add a period, a list of all available methods and properties will appear.
All objects support the Dispose method which is used to delete the object and free the resources it uses.
The Control keyword can be used with objects.
When an external method expects a file, the absolute path should use.
You can use AppPath to get the path of the application.
Bitmap1.New1 (AppPath & "\pic.jpg")

The dll files should be distributed together (in the same folder) with the compiled file.