读书人

CEdit类的setsel函数//第一个参数如何

发布时间: 2013-12-22 15:06:55 作者: rapoo

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;

读书人网 >VC/MFC

热点推荐