The topics in this section describe several ways that you can manager FdoPtr behavior. For more information about managing FdoPtr behavior, see the related topics “FdoPtr <T> Class Template Reference” and “FdoIDisposable Class Reference” in the FDO Reference Help and The Essential FDO.
psz = pclassDef ->GetProperties()->GetItem(0)->GetName())
The above code would result in two memory leaks. Instead use:
FdoPropertyDefinitionCollection* pprops = pclassDef -> GetProperties(); FdoPropertyDefinition* ppropDef = pprops->GetItem(0); psz = propDef->GetName(); ppropDef->Release(); pprops->Release();
FdoPtr<FdoPropertyDefinitionCollection> pprops = pclassDef-> GetProperties(); FdoPtr<FdoPropertyDefinition> ppropDef = pprops-> GetItem(0); psz = propDef->GetName();
psz = FdoPtr <FdoPropertyDefinition> (FdoPtr <FdoPropertyDefinitionCollection>(pclassDef->GetProperties())-> GetItem(0))->GetName();
FdoLineString* P = gf.CreateLineString(...); FdoPtr <FdoLineString> p2 = FDO_SAFE_ADDREF(p);