句柄方案 #ifndef CMyString class CMystring 方案1句柄#ndt class EXPORTORIMPORT IMyString class CMyString private private CMy m pthis char m psz public int m nLength public IMy String(const char * psz) CMy String(const char*psz) -IMy( CMyStringO const char* Find( const char *psz) const char*Find const char"psz); int Length int Length(;句柄方案 !方案 1 :句柄 #ifndef CMyString class CMyString; #endif class EXPORTORIMPORT IMyString { private: CMyString *m_pthis; public: IMyString(const char * psz); ~IMyString(); const char*Find(const char *psz); int Length(); }; class CMyString { private: char *m_psz; int m_nLength; public: CMyString(const char * psz); ~CMyString(); const char*Find(const char *psz); int Length(); };