|
|
 |
| Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET). |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Beginning VB 6 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

January 11th, 2006, 10:01 AM
|
|
Registered User
|
|
Join Date: Jan 2006
Location: Mumbai, MH, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Advantages /Disadvantages of ActiveX DLL & ActiveX
What are the main Advantages/Disadvantages of ActiveX DLL & ActiveX EXE in Visual Basic 6.0?
|

January 11th, 2006, 03:49 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , USA.
Posts: 1,065
Thanks: 0
Thanked 3 Times in 2 Posts
|
|
They serve two entirely different purposes. A dynamic link library project allows you to create your own type library. You can create your own library of classes in a project, compile it to a dll, then reference the dll from other projects to use the functionality (call methods and properties, etc.) of the classes your dll contains. The main advantage of using a dll is code reuseability. Compile your classes into a dll, then reference that one dll from as many apps as you like. The main disadvantage of COM dll's is what folks call "dll hell", having the dll file on your system in the wrong version or in the wrong place so that apps relying on its functionality can't find it or use it.
An exe project simply creates a standard WIN32 portable executable (pe) file that anyone running Windows can open. So for example, you could create a class library (dll), compile it, create an exe, reference your class library in the exe, compile the exe, then run the exe application, and the exe could use the functionality stored in the dll.
Something like that.
HTH,
Bob
|

January 16th, 2006, 03:25 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
well Bob... really "something like that" ...
your description of the ActiveX dll is correct, but the OP question was about an ActiveX exe, not a standard exe.
An ActiveX exe acts in a way like a standard exe, but it needs to be registered to run (like all other ActiveX objects), and like an ActiveX dll it exposes classes that clients can create and use.
There is a big differences between ActiveX dll and exe: the dll is an "in-proc" server, that is it runs in the same memory space of the main application, unlike the exe, that is a "out-proc" server, and therefore runs in its own memory space (it is basically another application running, in short) For this reason it is much faster to call a dll, because there is no marshalling of data between two processes.
Typically, ActiveX exe are used to create windows "servers", that can run locally or remotely in another computer. Incidentally, ActiveX exe are also used by VB programmers to create multi-threaded applications (see the Coffe Machine example in the VB documentation), because a ActiveX exe class created using CeateObject runs in its own thread of execution.
Well, this is in a nutshell...
To the OP: tell us if you need more information.
Marco
|

January 16th, 2006, 05:40 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , USA.
Posts: 1,065
Thanks: 0
Thanked 3 Times in 2 Posts
|
|
Thanks Marco,
Never used an ActiveX exe and wasn't aware of the distinction. Thanks for clarifying.
Bob
|

January 17th, 2006, 04:22 AM
|
|
Registered User
|
|
Join Date: Sep 2005
Location: Lahore, Punjab, Pakistan.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi; i've developed a S/W by using ADO; there is prob when I save images/employee photos in DB I can't retrieve it from DB;
DB is MS ACCESS;
plz help me out...rgds
F a z a l
A h m a d
|

February 19th, 2007, 09:14 AM
|
|
Registered User
|
|
Join Date: Jul 2006
Location: pune, maharashtra, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi
can u give me a scenario
i which condition i use Activex EXE & Dll
|

February 19th, 2007, 11:34 AM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
COM Components (either AcitveX dll or ActiveX exe) provide a way to decouple and deploy applications in a way allows for reuse of these components. Additionally, COM allows you to deploy components on different machines for distributed use.
For example, if you have an application server and a number of client machines you could write an ActiveX dll which you would install in a COM+ application on the application server which could then be accessed by all the client machines. This is often done to centralize business or data logic. Alternatively, if you didn't want to use COM+, you would write an ActiveX exe and use DCOM directly (which COM+ uses behind the scenes) for the client apps to be able to access the ActiveX exe.
Now days, it is not as common as it used to be in enterprise apps to use ActiveX exe's for the purpose of distributing since most of the time the cross machine work is done using COM+. However, there are still many reasons to use ActiveX exe's: One is to automate a stand-alone application so it's features can be directly used by a client app. Another is to allow one process to spawn other processes to be able to do work that runs asynchronously. Since you cannot do multi-threaded work in VB6, this allows you to control a number of processes from a single controller app to achieve a similar result.
ActiveX dlls are often used by a GUI form-based front end to provide the business layer in an n-tier application. For example, you could have a class that calculates tax. Once you have it working well, you want to use it for any application you write. By placing this class into its own ActiveX dll and registering it on a machine, any application that needs to use this code will be able to do so (as long as you write the code for it to do so).
In my use, almost all logic that is not directly GUI based is in an ActiveX dll.
Woody Z
http://www.learntoprogramnow.com
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |