Where are objects located?

Since an object is a complete programming package (sort of like the idea of a sub-program), it can be located in many different places. However, regardless of where the object is found, PowerBASIC will still handle all the messy details for you... automatically.

In many cases, objects will be located right within your main program. You can create a single, self-contained program, with one object or a thousand objects.  Get all the power of objects, but keep the details private -- for your eyes only.

Objects can be located in a Dynamic Link Library (DLL).  This is usually called a COM object, but is also known as an OCX or an ActiveX object.  The actual file extension is largely irrelevant. The subroutines offered by these objects are generally available to any program which knows the subroutine definitions, and wishes to access them.  This type of object is known as an "in-process" object because it is loaded into the address space of the calling application, just like a standard DLL.

Objects can also be located in an executable program (EXE).  In this case, the calling application is frequently called a "controller", as it can control how the executable operates by manipulating its objects.  A good example of this functionality is Microsoft Word -- by simply calling object subroutines, you can load a DOC file, display it to the user, make changes, then save the new document. All under the control of your calling application.  Once again, the object subroutines are generally available to any program which knows the subroutine definitions.  This type of object is known as an "out-of-process" object because it does not share address space with the calling application.

Whenever an object is accessed outside of your program, PowerBASIC uses the COM (Component Object Model) services of Windows to make the "connection" for you.  COM is an important tool which will open many opportunities for you.  But more about COM later...

 

See Also

What is an object, anyway?

Why should I use objects?

What are the parts of an object?

Are there other important "Buzz-Words"?