Re: VB ActiveX to VC 2005

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks for the info.


"MrAsm" <mrasm@xxxxxxx> wrote in message
news:ptth03tfu9odpi9qgfe59vqg49c3hkokqd@xxxxxxxxxx
On Mon, 26 Mar 2007 09:02:27 -0700, "Michael Tissington"
<mtissington@xxxxxxxxxxxxxxxx> wrote:

No - I want to rewrite my VB6 ActiveX control in VC8

Hi,

Maybe I did not understand your question well, but: are you aware that
building ActiveX controls in Visual Basic 6 and in Visual C++ are
*very different* kinds of jobs?

Using VB6 is much more easier; it's the VB6 drag-and-drop RAD
approach, with only some coding...

Please don't expect this RAD-style simplicity from Visual C++...

In fact, building an ActiveX with Visual C++ means choosing one of the
following options:

1. Raw C/C++ and Win32 (very hard path!)
2. Use C++ and MFC (more easy)
3. Use C++ and ATL

I would choose between 2 and 3.
If you already know MFC, you may consider option 2.

However, ATL is more focused than MFC on COM and ActiveX development
(in fact, ATL used to be the acronym for ActiveX Template Library - I
don't know if Microsoft changed the acronym words more recently...)
(In a way, ATL is to COM what MFC is to Win32 API.)

ATL offers you a set of disjoint C++ templates, while MFC contains an
interconnected hierarchy of classes.
So, with ATL you don't pay the size (or speed) penalty for a given
feature, unless you use it in your ActiveX.

ATL is leaner than MFC. Being made by C++ templates, ATL is just
compiled into source code: you don't need external DLLs or MFC static
libraries.

...Even if, with modern hardware and broad-band Internet connections,
this size/speed issues are not very important IMHO...

Morever, ATL uses multiple inheritance a lot (and it does make sense,
and I don't understand why the "gurus" who designed the new languages
like C# are against multiple inheritance; it seems that multiple
inheritance is only available in C++, not in Java nor in C#.)

However, it seems that MFC and ATL have been kind of "merged" together
in more modern Visual C++ compilers (in VS.NET 2003 there is a common
directory "atlmfc", and it seems that VS.NET MFC's CString is common
to ATL CString template - I don't know about VS2005, but I think that
this trend continues.). So, you could mix ATL and MFC to get the power
from both worlds.

MrAsm


.



Relevant Pages

  • Re: VB ActiveX to VC 2005
    ... building an ActiveX with Visual C++ means choosing one of the ... Use C++ and ATL ... If you already know MFC, ... ATL used to be the acronym for ActiveX Template Library - I ...
    (microsoft.public.vc.mfc)
  • Re: examples, tutorials, books
    ... That's because ATL doesn't support OLE and ActiveX ... This is the one area I recommend MFC ...
    (microsoft.public.vc.atl)
  • Re: Quest: Creating an ActiveX panel control...
    ... I think you need to start from the basics on creating ActiveX controls. ... always prefer using ATL rather than MFC, ...
    (microsoft.public.vc.mfc)
  • Re: Mixing MFC with WTL
    ... a member of 'ATL' ... MFC and ATL have been mixed together (in fact they share also some ... classes like the new CString template - note that VS6 MFC CString was ... does not support modern WTL templates? ...
    (microsoft.public.vc.mfc)
  • Re: "ATL COM AppWizard" vs. "MFC ActiveX ControlWizard"
    ... MFC ActiveX ControlWizard does exactly what it says: ... ATL COM AppWizard lets you develop COM servers using ATL. ...
    (microsoft.public.vc.mfc)