CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2005
    Posts
    64

    CComPtr and without? what is the ..

    Guys, what is the difference between these 2 :

    CComPtr <IMediaControl> pConfig;

    and

    IMediaControl *pConfig;

  2. #2
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Thumbs up Re: CComPtr and without? what is the ..

    CComPtr
    A COM interface specifying the type of pointer to be stored
    ATL uses this class and the CComQIPtr class to manage COM interface pointers. Both classes perform automatic reference counting through calls to AddRef and Release. Overloaded operators handle pointer operations. CComQIPtr additionally supports automatic querying of interfaces though QueryInterface.

    template< class T >
    class CComPtr


    in case of
    IMediaControl *pConfig;

    pConFig is a Object of IMediaControl or pConfig is a pointer to a IMediaControl Type . and here you have to handle AddRef and Release everything manually.which is a inbuild functionality of smart Pointer.Like

    CComPtr & CComQIPtr etc

    Better if you read First SmartPointer Concept and then move ahead.it's good

  3. #3
    Join Date
    Feb 2005
    Posts
    64

    Thumbs up Re: CComPtr and without? what is the ..

    sure .. thanks for the tips. humptydumpty

  4. #4
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Thumbs up Re: CComPtr and without? what is the ..

    U always welcome

  5. #5
    Join Date
    Mar 2004
    Location
    (Upper-) Austria
    Posts
    2,899

    Re: CComPtr and without? what is the ..

    [ Moved Thread ]
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured