Prerequisite for creating professional software or games.Įxample: Basic example of object call In order to access an external object (within a DLL for example), the objects' interface must first be declared: Interface MyObjectĮndInterface CreateObject is the function which creates the object, from the DLL, whose interface has just been defined. However, an understanding of these concepts and capabilities are in no way a Targeted towards, experienced programmers. Note: The concept of objects, and the capability provided within PureBasic for their use, has been developed for, and mainly The pseudotypes may be used for the parameters of the functions, but not for the return May be used to retrieve the index of the specified function. SizeOf may be used with Interfaces in order to get the size of the interface and OffsetOf Lists using the List keyword and maps using the Map keyword.Ī return type may be defined in the interface declaration by adding the type after the method. This is useful in order to do basic inheritance of objects.Īrrays can be passed as parameters using the Array keyword, (Theses functions are commonly called 'methods' in Object Oriented (OO) languages such as C++ or Java).Īll functions contained within the extended interface are then made available within the new interface and will be The optional Extends parameter may be used to extend another interface with new functions Most of the standard Windows interfaces have already been implemented within a residentįile and this allows direct use of these objects. It also introduces the necessary basis for Object Oriented programming within PureBasic,īut the use of interfaces requires some advanced knowledge. These types of libraries are becoming more and more common in Windows, and through the use of interfaces, the ability to access these modulesĮasily (and without any performance hit) is realized. Interfaces are used to access Object Oriented modules, such as COM (Component Object Model) or DirectX dynamic libraries (DLL).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |