Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 11th, 2006, 09:01 AM
Registered User
 
Join Date: Jan 2006
Location: Mumbai, MH, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Advantages /Disadvantages of ActiveX DLL & ActiveX

What are the main Advantages/Disadvantages of ActiveX DLL & ActiveX EXE in Visual Basic 6.0?
Reply With Quote
  #2 (permalink)  
Old January 11th, 2006, 02:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 10 Times in 9 Posts
Default

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

Reply With Quote
  #3 (permalink)  
Old January 16th, 2006, 02:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4 (permalink)  
Old January 16th, 2006, 04:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 10 Times in 9 Posts
Default

Thanks Marco,

Never used an ActiveX exe and wasn't aware of the distinction. Thanks for clarifying.

Bob

Reply With Quote
  #5 (permalink)  
Old January 17th, 2006, 03:22 AM
Registered User
 
Join Date: Sep 2005
Location: Lahore, Punjab, Pakistan.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to naasfama
Default

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
Reply With Quote
  #6 (permalink)  
Old February 19th, 2007, 08:14 AM
Registered User
 
Join Date: Jul 2006
Location: pune, maharashtra, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi
can u give me a scenario
i which condition i use Activex EXE & Dll
Reply With Quote
  #7 (permalink)  
Old February 19th, 2007, 10:34 AM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX DLL Joann Beginning VB 6 6 January 25th, 2007 07:50 PM
Datasets Advantages and Disadvantages aabdolrahmani ADO.NET 3 December 7th, 2006 08:56 AM
Advantages/Disadvantages SQL Server 2005 chevignona SQL Server 2005 1 July 28th, 2006 10:43 AM
Abt Advantages & disadvantages of Application Vari anandham Classic ASP Databases 1 May 13th, 2005 06:23 PM
Distribution of ActiveX DLL james gold Pro VB 6 6 September 10th, 2003 11:13 AM



All times are GMT -4. The time now is 11:13 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.