Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CMapStringToOb::Lookup
CMapStringToOb                              Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  BOOL Lookup( const char* key, CObject*& rValue ) const;
 
  Parameter   Description
 
  <key>       Specifies the string key that identifies the element to be
              looked up.
 
  <rValue>    Specifies the returned value from the looked-up element.
 
  Remarks
 
  Lookup uses a hashing algorithm to quickly find the map element with a
  key that matches exactly (CString value).
 
  Return Value
 
  TRUE if the element was found; otherwise FALSE.
 
  Example
 
  CMapStringToOb map;
  CAge* pa;
 
  map.SetAt( "Bart", new CAge( 13 ) );
  map.SetAt( "Lisa", new CAge( 11 ) );
  map.SetAt( "Homer", new CAge( 36 ) );
  map.SetAt( "Marge", new CAge( 35 ) );
  ASSERT( map.Lookup( "Lisa", pa ) ); // Is "Lisa" in the map?
  ASSERT( *pa ==  CAge( 11 ) ); // Is she 11?
 
 
  See Also
 
  CMapStringToOb::operator []
 
 
                                     -♦-