Hi all,
I want the Difference b/w Active-X ctrl and Active-X Dll in terms of the Interface usage/vtTable(ie.Internal Differences and Internal Workings)...I know that it is an InProcess Components.
Thanx
Murali
Printable View
Hi all,
I want the Difference b/w Active-X ctrl and Active-X Dll in terms of the Interface usage/vtTable(ie.Internal Differences and Internal Workings)...I know that it is an InProcess Components.
Thanx
Murali
This is what MSDN has to say about it:
ActiveX EXEs and DLLs
ActiveX controls allow developers to assemble software components that encapsulate business logic and data. ActiveX EXE and DLL components are well suited to building business objects because they are designed to provide services (public methods and properties) to a whole range of client components. An application that uses a component’s code, by creating objects and calling their properties and methods, is referred to as a client.
An ActiveX EXE is classified as an out-of-process component because it runs in its own process space, separate from the application using it. Because an ActiveX EXE executes in its own process space, you can use a single occurrence of an object with many other applications at once, much in the same way that Data Access Objects (DAO) are used throughout a range of applications. The downside is performance degradation caused by the extra overhead undertaken in communicating with external processes. (Look back at Figure 3-5 to see how an ActiveX EXE component interacts with its clients.)
An ActiveX DLL is classified as an in-process component that coexists in the same process space as the application using it. Sharing process space with the application, an ActiveX DLL executes methods and properties more quickly than its EXE counterpart because no extra communication overhead is needed to reference it. ActiveX DLLs do have disadvantages, however; many restrictions are imposed on the way they can be designed and used. (Refer to Visual Basic Books Online for further details.) The real benefit of an ActiveX DLL is in providing common control functionality for its host application. Stripping text out of a string and replacing it with new text is an example of a common method well suited for DLL use. Most of the examples provided later in this chapter use the CommonMethodsAndProperties ActiveX DLL, which provides a range of methods and properties to act as a link between the business object and the actual report generation utilities.
A new feature in Visual Basic 5 is the ability to compile applications to native code, which can result in substantial gains in speed over the interpreted versions of the same application. Unfortunately, this new feature provides little or no improvement for the type of EXE and DLL created in this chapter. The examples here make intensive use of COM, string manipulation, VBA run-time libraries, and inline processes. In all these situations, the code is already optimized by being in a precompiled format, so no benefits can be gained from compiling the code that calls these components.
You can, however, use this new compile feature to enhance the performance of routines that use computationally intensive algorithms as well as those that manipulate arrays or classes set up as data collections. Visual Basic Books Online contains a section called “Compiled vs. Interpreted Applications” that provides some general guidelines regarding native-code compilation.
Note Visual Basic ActiveX DLLs are not referenced in the same manner as traditional DLLs. The Dim statement is used instead of the Declare statement.