首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

CEdit类的setsel函数//第一个参数如何还是-1?DWORD不是unsigned long.

2013-12-22 
CEdit类的setsel函数//第一个参数怎么还是-1?DWORD不是unsigned long...void SetSel( DWORD dwSelection,

CEdit类的setsel函数//第一个参数怎么还是-1?DWORD不是unsigned long...
void SetSel( DWORD dwSelection, BOOL bNoScroll = FALSE ); 
dwSelection 
Specifies the starting position in the low-order word and the ending position in the high-order word. If the low-order word is zero and the high-order word is –1, all the text in the edit control is selected. If the low-order word is –1, any current selection is removed. 

[解决办法]
use:
void SetSel(int nStartChar, int nEndChar, BOOL bNoScroll = False);
[解决办法]

引用:
下面参数解释不是说赋值为-1吗???DWORD不是unsigned long吗?怎么能赋值为-1呢?

Quote: 引用:

根据解释,这里的所谓dword实际上是表示4个字节而已。高位2字节和低位2字节可分开用。

高低两个字可分别赋值,无符号也好,有符号也好,总归是4个字节32位吧?每一位不是0便是1。short h = -1;short l=0;dword a = (h<<16)
[解决办法]
l;

热点排行