如何解决manifest引起的Combox的GetEditSel()异常
如何解决manifest引起的Combox的GetEditSel()异常
ABC.exe.manifest文件如下
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="5.1.0.0"
type="win32"
name="abc.exe"/>
<description>Test Application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.1.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
</assembly>
//GetEditSel()如下使用
void CAutoCompletComboBox::OnEditUpdate()
{
// if we are not to auto update the text, get outta here
if (!m_bAutoComplete)
return;
// Get the text in the edit box
CString str;
GetWindowText(str);
int nLength = str.GetLength();
// Currently selected range
DWORD dwCurSel = GetEditSel();
WORD dStart = LOWORD(dwCurSel);
WORD dEnd = HIWORD(dwCurSel);
// Search for, and select in, and string in the combo box that is prefixed
// by the text in the edit box
if (SelectString(-1, str) == CB_ERR)
{
SetWindowText(str); // No text selected, so restore what was there before
if (dwCurSel != CB_ERR)
SetEditSel(dStart, dEnd); //restore cursor postion
}
// Set the text selection as the additional text that we have added
if (dEnd < nLength && dwCurSel != CB_ERR)
SetEditSel(dStart, dEnd);
else
SetEditSel(nLength, -1);
}
为什么如果加在ABC.exe.manifest文件GetEditSel()返回的结果就是65537
除去ABC.exe.manifest文件返回值就是正常的,请问在保留此文件的情况下该怎么解决?多谢!
ABC.exe.manifest文件如下
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="5.1.0.0"
type="win32"
name="abc.exe"/>
<description>Test Application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.1.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
</assembly>
//GetEditSel()如下使用
void CAutoCompletComboBox::OnEditUpdate()
{
// if we are not to auto update the text, get outta here
if (!m_bAutoComplete)
return;
// Get the text in the edit box
CString str;
GetWindowText(str);
int nLength = str.GetLength();
// Currently selected range
DWORD dwCurSel = GetEditSel();
WORD dStart = LOWORD(dwCurSel);
WORD dEnd = HIWORD(dwCurSel);
// Search for, and select in, and string in the combo box that is prefixed
// by the text in the edit box
if (SelectString(-1, str) == CB_ERR)
{
SetWindowText(str); // No text selected, so restore what was there before
if (dwCurSel != CB_ERR)
SetEditSel(dStart, dEnd); //restore cursor postion
}
// Set the text selection as the additional text that we have added
if (dEnd < nLength && dwCurSel != CB_ERR)
SetEditSel(dStart, dEnd);
else
SetEditSel(nLength, -1);
}
为什么如果加在ABC.exe.manifest文件GetEditSel()返回的结果就是65537
除去ABC.exe.manifest文件返回值就是正常的,请问在保留此文件的情况下该怎么解决?多谢!
...全文
相关推荐
基于springboot的校园社交平台源码数据库文档.zip
基于springboot的校园社交平台源码数据库文档.zip
springboot项目校园交友网站.zip
springboot项目校园交友网站,含有完整的源码和报告文档
基于SSM框架的校园微博源码数据库.zip
基于SSM框架的校园微博源码数据库.zip
springboot709校友社交系统--论文(文档+源码)_kaic.zip
计算机毕业设计
【java毕业设计】校园交友网站源码(springboot+vue+mysql+说明文档+LW).zip
功能说明: 系统主要包括首页、个人中心、用户管理、线下活动管理、交友信息管理、活动报名管理、交流论坛、系统管理等功能模块。 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse


