Solved

Activex Controls

Posted on 1998-11-23
2
202 Views
Last Modified: 2013-12-14
I want to know the difference between creating a control through ATLComAppWizard and MFCActivexControl wizard.To my knowledge the later uses MFC and ATL won't use MFC.

More info??
Thanx
0
Comment
Question by:anilkumarv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 0 total points
ID: 1178527
MFC is a big _fat_ library with lots of functionality.  When you use MFC a big DLL is required to run your control, (or you can link the MFC library statically).  Adding about 1Mb to the download size.  However using MFC makes it much easier to add other Windows functionality (e.g. dialog boxes, graphics, ODBC data access, etc) to your control.

ATL is a small library without much functionality, except for writing OCX.  Basically with an ATL control you have to write all the Windows functionality from scratch using SDK style code (hard work).  The advantage is that your control is small to download.  However remember if you control includes lots of Windows functionality, you basically end up writing your own mini-MFC-like  framework - so don't underestimate (a) the amount of extra of work that may be involved for writing with ATL - also overestimate (b) the reduction in control size - for large sophisticated controls - this may be less than you think - because extra code is required from you.  

Another advantage for using ATL, is that if your control is usually quicker to instantiate (MFC doesn't have to be loaded into memory).  If you invoke the same control a million times in quick succession, using ATL.

Some people also think the ATL wrapper round COM is nicer than MFC's.  Personally I think there's not much in it.  Because of this, it's actually possible to write an ATL control, that uses MFC too.  This ofcourse negates any reduction in size advantage (because the big fat MFC libraries are still required).

Finally MFC can also be used to write full Windows apps.  ATL does not have any support for that.

One other

So in summary

MFC Controls
--------------------
For :
Easy to write (large supporting framework)
Easy to migrate existing MFC apps
Easy to share code with existing MFC apps

Against:
Large download size (requires MFC statically linked, or MFC DLLs)
Slow to invoke (MFC must be loaded)

Use if
(a) You have an existing MFC app/code you want to convert to a control
(b) You know MFC
(c) You care more about development time, than download time


ATL
--------
For:
Small downloads
Quick to invoke

Against:
Harder to write (you must call SDK/API style functions to do work)

Use if
(a) You care less about development time, than download time


ATL + MFC
-----------------
For :
Easy to write (large supporting framework)
Easy to migrate existing MFC apps
Easy to share code with existing MFC apps

Against:
Large download size (requires MFC statically linked, or MFC DLLs)
Slow to invoke (MFC must be loaded)

Use if
(a) Migrating/Transitioning MFC code to ATL
(b) You like ATL's wrapper on COM better than MFC


One last point, if you control is only ever gonna be hosted by an MFC app, you should consider putting C++ classes into an MFC extension DLL, and forget using a control.  The advantage for this is speed, performance and ease of development.  The disadvantage is it is difficult for third parties to interface to your control (they are highly vulnerable to version changes).

0
 

Author Comment

by:anilkumarv
ID: 1178528
Thanx,
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Eclipse Neon start with Admin account only 6 179
What is the Best Editor for PHP Development ? 5 109
Online file editor, manager 6 123
Error in Visual Project 10 48
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question