Advantage of ActiveX Dll over
Active Exe ?
ACTIVEX DLL:
=============
An in-process component, or ActiveX DLL, runs in another
application’s process. In-process components are used by
applications or other in-process components. this allows you to
wrap up common functionality (like an ActiveX Exe).
ACTIVEX EXE:
=============
An out-of-process component, or ActiveX EXE, runs in its own
address space. The client is usually an application running in
another process.The code running in an ActiveX Exe is running in
a separate process space. You would usually use this in N-Tier
programming.
An ActiveX EXE runs out of process while an ActiveX DLL runs in
the same process space as VB app. Also, and ActiveX EXE can be
run independent of your application if desired.
Explain single thread and multithread thread apartments
All components created with Visual Basic use the apartment
model, whether they’re single-threaded or multithreaded. A
single-threaded component has only one apartment, which contains
all the objects the component provides.
This means that a single-threaded DLL created with Visual Basic
is safe to use with a multithreaded client. However, there’s a
performance trade-off for this safety. Calls from all client
threads except one are marshaled, just as if they were
out-of-process calls.
What is a Component?
If you compile an ActiveX dll, it becomes a component.
If you compile an ActiveX Control, it becomes both a component
and a control. Component is a general term used to describe code
that's grouped by functionality. More specifically, a component
in COM terms is a compiled collection of properties/methods and
events.
Typically a component is loaded into your project via the
References whereas an ActiveX Control is loaded into your
project via "components".
|