Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Smart Pointers

Smart Pointers

Scheduled Pinned Locked Moved ATL / WTL / STL
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qur
    wrote on last edited by
    #1

    I have little confusion that i wanted to clear out. Please see the following code: //defination SetMstrRS(IMstrRS * pMS); CComPtr <IMstrRS> pMS; pMS.CoCreateInstance(...); SetMstrRS(pMS); Now in the last statment is AddRef called by SmartPointer before it is passed to the method. thanks in advance qur

    M 1 Reply Last reply
    0
    • Q qur

      I have little confusion that i wanted to clear out. Please see the following code: //defination SetMstrRS(IMstrRS * pMS); CComPtr <IMstrRS> pMS; pMS.CoCreateInstance(...); SetMstrRS(pMS); Now in the last statment is AddRef called by SmartPointer before it is passed to the method. thanks in advance qur

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      No, the interface is not AddRef'd because the parameter is created by a call to the operator T* converter, which just returns the encapsulated interface pointer. Step through the code to see for yourself. --Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber CP SearchBar v2.0.2 released

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups