locked
ATL classes which do not need ATL library RRS feed

  • Question

  • Recently I discovered the useful ATL class CPath. I used it in a MFC application. I am not linking either dynamically or statically to the ATL library. My application built with no errors.

    Evidently there is a large set of ATL template classes which can be used in an MFC application without needing the ATL library. Is there a list of these ATL classes anywhere ?

    Tuesday, April 17, 2012 2:21 PM

Answers

  • Recently I discovered the useful ATL class CPath. I used it in a MFC application. I am not linking either dynamically or statically to the ATL library. My application built with no errors.

    Evidently there is a large set of ATL template classes which can be used in an MFC application without needing the ATL library. Is there a list of these ATL classes anywhere ?

    You are using CPath that's why you don't need ATL like if you use CString you don't need ATL but if you use CStringT or CPathT you have to add atl header file inside your code.Here is a List for ATL/MFC shared class

    Thanks


    Rupesh Shukla

    • Proposed as answer by Helen Zhao Friday, April 20, 2012 6:23 AM
    • Marked as answer by Helen Zhao Wednesday, April 25, 2012 2:14 AM
    Tuesday, April 17, 2012 3:53 PM
  • Click on

    Classes Shared Between MFC and ATL

    Thanks


    Rupesh Shukla


    That does not answer my OP. Try reading it and you will understand it. Did I ask about classes shared by MFC and ATL ? No.

    Had read your question .This is what i want to tell you

    typedef CPathT<CString> CPath; if you  are using CPath you have to use atlpath.h inside your code . Second Shared classes means you can use those classes in MFC and ATL without adding any extra classes. You can't use CPath without atlpath.h. That's all i can explain you . And if any class is a ATL class you have to use ATL header file and if this is a MFC you have to add corresponding header file.Nothing else

    Second thing you can provide ATL support to your MFC project by using header file only you don't have to use lib etc

    Thanks


    Rupesh Shukla


    • Edited by Pintu Shukla Wednesday, April 18, 2012 1:29 AM
    • Marked as answer by Helen Zhao Wednesday, April 25, 2012 2:14 AM
    Wednesday, April 18, 2012 1:28 AM

All replies

  • Recently I discovered the useful ATL class CPath. I used it in a MFC application. I am not linking either dynamically or statically to the ATL library. My application built with no errors.

    Evidently there is a large set of ATL template classes which can be used in an MFC application without needing the ATL library. Is there a list of these ATL classes anywhere ?

    You are using CPath that's why you don't need ATL like if you use CString you don't need ATL but if you use CStringT or CPathT you have to add atl header file inside your code.Here is a List for ATL/MFC shared class

    Thanks


    Rupesh Shukla

    • Proposed as answer by Helen Zhao Friday, April 20, 2012 6:23 AM
    • Marked as answer by Helen Zhao Wednesday, April 25, 2012 2:14 AM
    Tuesday, April 17, 2012 3:53 PM
  • Recently I discovered the useful ATL class CPath. I used it in a MFC application. I am not linking either dynamically or statically to the ATL library. My application built with no errors.

    Evidently there is a large set of ATL template classes which can be used in an MFC application without needing the ATL library. Is there a list of these ATL classes anywhere ?

    You are using CPath that's why you don't need ATL like if you use CString you don't need ATL but if you use CStringT or CPathT you have to add atl header file inside your code.Here is a List for ATL/MFC shared class

    Thanks


    Rupesh Shukla


    Adding a header file I already know. But some of the ATL headers require linking with the ATL library while others do not. I am looking for a list of ATL header files which can be used in MFC without having to link to the ATL library.
    Tuesday, April 17, 2012 8:23 PM

  • Adding a header file I already know. But some of the ATL headers require linking with the ATL library while others do not. I am looking for a list of ATL header files which can be used in MFC without having to link to the ATL library.

    Check out the link mentioned in my last post . It has All the information you want.

    Thanks


    Rupesh Shukla

    Tuesday, April 17, 2012 9:00 PM

  • Adding a header file I already know. But some of the ATL headers require linking with the ATL library while others do not. I am looking for a list of ATL header files which can be used in MFC without having to link to the ATL library.

    Check out the link mentioned in my last post . It has All the information you want.

    Thanks


    Rupesh Shukla

    No, it does not have the information I want.
    Tuesday, April 17, 2012 9:38 PM
  • Click on

    Classes Shared Between MFC and ATL

    Thanks


    Rupesh Shukla

    Tuesday, April 17, 2012 10:43 PM
  • Click on

    Classes Shared Between MFC and ATL

    Thanks


    Rupesh Shukla


    That does not answer my OP. Try reading it and you will understand it. Did I ask about classes shared by MFC and ATL ? No.
    Tuesday, April 17, 2012 11:24 PM
  • Click on

    Classes Shared Between MFC and ATL

    Thanks


    Rupesh Shukla


    That does not answer my OP. Try reading it and you will understand it. Did I ask about classes shared by MFC and ATL ? No.

    Had read your question .This is what i want to tell you

    typedef CPathT<CString> CPath; if you  are using CPath you have to use atlpath.h inside your code . Second Shared classes means you can use those classes in MFC and ATL without adding any extra classes. You can't use CPath without atlpath.h. That's all i can explain you . And if any class is a ATL class you have to use ATL header file and if this is a MFC you have to add corresponding header file.Nothing else

    Second thing you can provide ATL support to your MFC project by using header file only you don't have to use lib etc

    Thanks


    Rupesh Shukla


    • Edited by Pintu Shukla Wednesday, April 18, 2012 1:29 AM
    • Marked as answer by Helen Zhao Wednesday, April 25, 2012 2:14 AM
    Wednesday, April 18, 2012 1:28 AM
  • eldiener wrote:
    >
    >Recently I discovered the useful ATL class CPath. I used it in a MFC
    >application. I am not linking either dynamically or statically to the
    >ATL library. My application built with no errors.
    >
    >Evidently there is a large set of ATL template classes which can be
    >used in an MFC application without needing the ATL library.
     
    Very few ATL classes need any run-time support.  That's why I love them.
     
    >Is there a list of these ATL classes anywhere ?
     
    I have found ATL to be underdocumented and hence woefully underutilized. In
    my view, the best place to find out about them is in the source code, in
    your Visual Studio directory in VC\atlmfc\include\atl\atl*.h.
     
    The CAtlFile and CRegKey classes are particularly useful, as are the
    wrappers in atlsync.h.  And, of course, if you have to do anything at all
    with COM, CComPtr and CComQIPtr are indispensible.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    Thursday, April 19, 2012 6:33 AM
  • Click on

    Classes Shared Between MFC and ATL

    Thanks


    Rupesh Shukla


    That does not answer my OP. Try reading it and you will understand it. Did I ask about classes shared by MFC and ATL ? No.

    Had read your question .This is what i want to tell you

    typedef CPathT<CString> CPath; if you  are using CPath you have to use atlpath.h inside your code . Second Shared classes means you can use those classes in MFC and ATL without adding any extra classes. You can't use CPath without atlpath.h. That's all i can explain you . And if any class is a ATL class you have to use ATL header file and if this is a MFC you have to add corresponding header file.Nothing else

    Second thing you can provide ATL support to your MFC project by using header file only you don't have to use lib etc

    Thanks


    Rupesh Shukla



    Unfortunately your information has nothing to do with my question. It would have been better just to not answer rather than provide information which has nothing to do with an OP.
    Thursday, April 19, 2012 10:08 PM
  • eldiener wrote:
    >
    >Recently I discovered the useful ATL class CPath. I used it in a MFC
    >application. I am not linking either dynamically or statically to the
    >ATL library. My application built with no errors.
    >
    >Evidently there is a large set of ATL template classes which can be
    >used in an MFC application without needing the ATL library.
     
    Very few ATL classes need any run-time support.  That's why I love them.
     
    >Is there a list of these ATL classes anywhere ?
     
    I have found ATL to be underdocumented and hence woefully underutilized. In
    my view, the best place to find out about them is in the source code, in
    your Visual Studio directory in VC\atlmfc\include\atl\atl*.h.
     
    The CAtlFile and CRegKey classes are particularly useful, as are the
    wrappers in atlsync.h.  And, of course, if you have to do anything at all
    with COM, CComPtr and CComQIPtr are indispensible.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.

    Thanks ! I just don't have the time to waste to read source code just to determine if use of an ATL template class requires linking with the ATL library. Easier is to just use the instantiated template and find out. No doubt it is foolish of me to expect Microsoft to document which ATL classes require linking to the ATL library and which do not.

    I do agree with you that ATL has many useful template classes which can be used in code and which has little to do with ActiveX. That just shows the programming level of Microsoft's designers.

    Thursday, April 19, 2012 10:14 PM

  • Unfortunately your information has nothing to do with my question. It would have been better just to not answer rather than provide information which has nothing to do with an OP.

    You are right .i should not answer these type of question .When someone don't want to learn anything have no right to make him understand the fact.

    Thanks


    Rupesh Shukla

    Friday, April 20, 2012 1:13 PM
  • eldiener wrote:
    >
    >Thanks ! I just don't have the time to waste to read source code just
    >to determine if use of an ATL template class requires linking with
    >the ATL library.
     
    I understand what you're trying to say, but in my opinion, you cannot avoid
    the source code when you want to use template libraries.
     
    >I do agree with you that ATL has many useful template classes which can
    >be used in code and which has little to do with ActiveX. That just shows
    >the programming level of Microsoft's designers.
     
    No, that's not a fair assessment.  Microsoft periodically goes through
    these "branding orgies", where everything that comes out in a given period
    has some special brand.  In the mid-1990s, everything was Active.  ActiveX,
    Active Template Library, ActiveMovie (which was eventually released as
    DirectShow).  For a while, everything was Direct.  Then, everything was
    .NET.  Then, everything was Live.
     
    It's not easy to come up with a good name for a very general purpose
    library.  Active Template Library is probably as good a name as any.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    Sunday, April 22, 2012 2:48 AM
  • eldiener wrote:
    >
    >Thanks ! I just don't have the time to waste to read source code just
    >to determine if use of an ATL template class requires linking with
    >the ATL library.
     
    I understand what you're trying to say, but in my opinion, you cannot avoid
    the source code when you want to use template libraries.
     
    >I do agree with you that ATL has many useful template classes which can
    >be used in code and which has little to do with ActiveX. That just shows
    >the programming level of Microsoft's designers.
     
    No, that's not a fair assessment.  Microsoft periodically goes through
    these "branding orgies", where everything that comes out in a given period
    has some special brand.  In the mid-1990s, everything was Active.  ActiveX,
    Active Template Library, ActiveMovie (which was eventually released as
    DirectShow).  For a while, everything was Direct.  Then, everything was
    .NET.  Then, everything was Live.
     
    It's not easy to come up with a good name for a very general purpose
    library.  Active Template Library is probably as good a name as any.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.

    The C++ standard library consists largely of template classes. Do you look through the source code before you use any one class of the library ? I look at the documentation.

    My remark about the programming level of Microsoft's designers referred to the fact that quite a number of template classes in the ATL have absolutely nothing to do with ActiveX, and therefore should have been put in a separate C++ library which could have been used by any C++ module. This is precisely what triggered my OP.

    Monday, April 23, 2012 3:11 PM