putref Question
-
Ok I am confused: I would like to implement putref_Item property to be accessed from vbscript/Jscript putref_Item(BSTR name, VARIANT newVal) { ... //set to IDispatch CComVariant vtOld = map.Lookup(name); map.Set(name, newVal); } VBScript Dim z z = Server.CreateObject( Dummy.Object) Set X("db") = z Set X("db") = Nothing ........................................................ How does reference counting suppose to works? Should I call vtOld->Release() vtNew->AddRef() Should I call addRef on propGet ??? Thanks
-
Ok I am confused: I would like to implement putref_Item property to be accessed from vbscript/Jscript putref_Item(BSTR name, VARIANT newVal) { ... //set to IDispatch CComVariant vtOld = map.Lookup(name); map.Set(name, newVal); } VBScript Dim z z = Server.CreateObject( Dummy.Object) Set X("db") = z Set X("db") = Nothing ........................................................ How does reference counting suppose to works? Should I call vtOld->Release() vtNew->AddRef() Should I call addRef on propGet ??? Thanks
Nevermind use smart ComPtrs and don't worry about these things