BOOL IsLoading() const;
Determines if the archive is loading data. This member function is called by the Serialize functions of the archived classes.
TRUE if the archive is currently being used for loading; otherwise FALSE.
int i;
extern CArchive ar;
if( ar.IsLoading() )
ar >> i;
else
ar << i;