The IVariantDictionary::get_Count method returns the number of items in either the Contents or StaticObjects collection.
HRESULT STDMETHODCALLTYPE get_Count( int*cStrRet\\a pointer to an integer containing the number of items )
Application Contents Collection, Application StaticObjects Collection, Session Contents Collection, Session StaticObjects Collection