- 博客(1)
- 资源 (5)
- 收藏
- 关注
原创 cad二次开发中,vc7下无法附加进行的解决办法
vs2002中的调试中的附加点击后,提示没有正确安装解释器: 解决步骤: 1,在运行处输入cmd 2,然后输入命令:cd C:\Program Files\Common Files\Microsoft Shared\VS7Debug 3, 再输入命令:mdm.exe /regserver 4,再到服务里查看是否有 Machine Debug Manager服务,此服务如果停止则启
2012-09-21 13:55:01 680
C++自己实现的字符串类
自己实现的字符串类
class CMStringImp;
class CMstring
{
public:
explicit CMstring(void);
~CMstring(void);
CMstring(LPCTSTR lpszstr);
CMstring(const CMstring& lpszstr);
CMstring& operator = (const CMstring& lpszstr);
operator LPCTSTR() const;
bool operator == (const CMstring&) const;
bool operator != (const CMstring&) const;
bool operator < (const CMstring&) const;
TCHAR operator[] (int nIndex) const;
TCHAR& operator[] (int nIndex);
CMstring& operator += (LPCTSTR pStr);
CMstring& operator += (TCHAR ch);
friend CMstring operator+(const CMstring& str1, const CMstring& str2);
friend CMstring operator+(const CMstring& str1, LPCTSTR lpszstr);
friend CMstring operator+(const CMstring& str1, TCHAR ch);
friend CMstring operator+(TCHAR ch, const CMstring& str1);
friend CMstring operator+(LPCTSTR lpszstr, const CMstring& str1);
// friend wostream operator <<(wostream &is;,const CMstring &str;);
public:
LPCTSTR GetData() const;
bool IsEmpty() const;
TCHAR GetAt(int) const;
TCHAR& GetAt(int);
int GetLength() const;
int Compare(const CMstring&) const;
int CompareNoCase(const CMstring&) const;
int Find(TCHAR ch, int nStart = 0) const;
int Find(LPCTSTR pStr, int nStart = 0) const;
int ReverseFind(TCHAR ch) const;
int ReverseFind(LPCTSTR pStr) const;
CMstring Right(int nCount) const;
CMstring Left(int nCount ) const;
public:
CMstring& MakeLower();
CMstring& MakeUpper();
CMstring& MakeReverse();
int Replace(TCHAR chOld, TCHAR chNew);
int Replace(LPCTSTR pszOld, LPCTSTR pszNew);
int Insert(int iIndex, TCHAR ch);
void Format(LPCTSTR lpszFormat, ...);
private:
CMStringImp* m_pImp;
};
2019-04-23
C++ vs2005开发的 树控件实例
一个用vs2005开发的应用程序【源代码】,其中后台用了一个二叉树,前台是一个CTreeCtrl 由于现实,还牵涉到文件的读取【读取到CTreeCtrl 里面】,还有节点的删除,插入等等,【其中每个节点有2个字段用“|”分开,第一个为标示符,第二个为面积【这个可以自己扩展】,计算面积系数之后增加为三个字段】
这个是本人第一次使用MFC开发比较大的东西,有错误的地方还望指出
【树控件上有右键菜单,可以删除,添加,计算面积系数=所有父节点面积系数【根节点为0】+本节点面积/(本节点的面积+所有孩子节点及孩子节点的面积之和)
文件的存储和读取也是一个难点,内部有测试实例可以自己测试,研究!
2012-03-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人