O'Reilly logo

VB & VBA in a Nutshell: The Language by Paul Lomax

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.5. Creating ActiveX Components

In the Professional and Enterprise editions of Visual Basic, you can use class modules to create ActiveX components and compile them as either ActiveX DLLs or ActiveX EXEs. The choice you are faced with, effectively, is whether you require an in-process or an out-of-process component.

4.5.1. In-Process Components

An ActiveX DLL is an in-process component. But why is it called "in-process"?

In 16-bit Windows, a DLL effectively became part of the operating system, and all running processes had access to the DLL. A handle to the DLL could be obtained centrally from the operating system, and the operating system knew at any given time how many (if any) handles to a particular DLL had been issued. In 32-bit Windows, a DLL doesn't become part of the operating system. It becomes part of the process space of the application that calls the DLL. A call to a DLL forces the operating system to create a file mapping object for the DLL. This object is then mapped into the process space of the client or calling process. Hence the term in process.

4.5.2. Out-of-Process Components

When you create an ActiveX EXE, you are creating an out-of-process component. An ActiveX EXE runs as a separate process with its own threads. This is ideal for cases in which multiple applications (or multiple clients) are likely to require the functionality offered by the classes included in the ActiveX EXE. Moreover, an ActiveX EXE need not reside on the same system as its client; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required