Visual Basic Concepts
>
Building Code Components
Code components, formerly called OLE servers, are libraries of objects that provide an easy way to package your code for reuse. For example, you can create libraries of procedures that can be used with Microsoft Visual Basic or with desktop applications that host Visual Basic for Applications, such as Microsoft Office.
With the Enterprise Edition of Visual Basic, code components can become parts of enterprise systems, running unattended on remote computers to provide data services and business rules. The information in "Scalability and Multithreading" and "Asynchronous Call-Backs and Events" will be of particular interest in this context.
Code components can be wizards and add-ins for Visual Basic. Extending the Visual Basic Environment with Add-Ins, in the Component Tools Guide, describes how to create wizards and add-ins. Many of the topics in this chapter provide useful background information for creating add-ins.
"Building Code Components" assumes familiarity with the material in "General Principles of Component Design" and "Debugging, Testing, and Deploying Components," as well as "Programming with Objects," in the Visual Basic Programmer’s Guide.
The following topics describe key features of code components created with Visual Basic.
Topics
Sample application
.gif) | Coffee2.vbp, CoffWat2.vbp, MTCoffee.vbp Coffee2.vbp and CoffWat2.vbp demonstrate two techniques for asynchronous notifications — events and call-back methods on a secondary interface — and provide an example of all-code timers you can use instead of the Timer control. MTCoffee.vbp illustrates some features of multithreading. The sample applications are listed in the directory. |
For More Information See "Creating an ActiveX EXE Component," for step-by-step procedures that illustrate multithreading and asynchronous processing. Similar step-by-step procedures in "Creating an ActiveX DLL," illustrate global objects and modeless forms. Visual Basic code components can also provide ActiveX documents, as discussed in "Building ActiveX Documents."