唉!不要乱用函数哦,特别是你不熟悉的!
来源:互联网 发布:gta4优化代码 编辑:程序博客网 时间:2024/05/09 10:02
编程心得
------调试和错误
今天找了错误找了半天!!起码三个小时!!!就因为下面这一行代码。导致我程序处处有错!!!!
本来可以用 :m_IDGetitemText(Pos,0);这样的重载函数完成的,我非得用下面犯错的那个!!
结果第四个参数搞不懂什么回事,就乱写了一个!谁知道出错了,这个m_ID变量是跟数据库关联的,这个字段的值长度已定为 16,但是我非得弄个20!!!!
最后也是作死,各种错误!!!!!!
m_Grid.GetItemText(Pos,0,(LPTSTR)(LPCTSTR)m_ID,20);//最后一个参数是说明 :缓冲区的长度指向 由第三个参数指向,但是因为
//数据库里面对字段域有限制,所以这里不匹配的话很容易出错的!!!找了大半天
//各种不知名的错误的源头就是它!!!!
Retrieves the text of a list view item or subitem.
int GetItemText( int nItem, int nSubItem, LPTSTR lpszText, int nLen ) const;CString GetItemText( int nItem, int nSubItem ) const;
int GetItemText( int nItem, int nSubItem, LPTSTR lpszText, int nLen ) const;CString GetItemText( int nItem, int nSubItem ) const;
The version returning int returns the length of the retrieved string.
The version returning a CString returns the item text.
If nSubItem is zero, this function retrieves the item label; ifnSubItem is nonzero, it retrieves the text of the subitem. For more information on the subitem argument, see the discussion of theLVITEM structure in the Windows SDK.
- 唉!不要乱用函数哦,特别是你不熟悉的!
- 不要乱用EqualsBuilder的appendSuper
- 不要闯入自己不熟悉的领地
- 不熟悉的方法不要随便用
- perror函数不能乱用的
- memset 不要乱用
- 不要乱用maxdos
- 内部类 不要乱用
- 那些你不熟悉的html元素属性
- 熟悉你所不熟悉的JDK JVM
- 不熟悉的C字符串处理函数
- oracle 不要乱用between and
- 雷人的短信别乱用哦!!!
- 【rzxt】你不熟悉的Windows8系统Metro版的QQ
- 你可能还不熟悉的VC6.0 IDE
- 你可能还不熟悉的VC6.0 IDE
- ios开发你所不熟悉的冷知识
- 一些常用而你却不熟悉的布局属性
- 算法竞赛入门经典 第三章 uVA455 - Periodic Strings
- Android Studio与Eclipse SDK无法更新解决方案
- LRU Cache
- OC-NSNumber
- HDU2561(排序)
- 唉!不要乱用函数哦,特别是你不熟悉的!
- Android开发之旅:环境搭建及HelloWorld
- php无限级分类并把末级产品展示出来的思路
- 让程序崩溃后生成Core Dump
- PHP串行化与反串行化的调用
- 散散心得,cc自己看,因为理解诶还不够
- C++基础知识容易忽略的知识点
- C----------LessonCondition
- springMVC类型转换,@initBinder使用