使用LVS_REPORT的ListView控件导致应用程序崩溃 [英] ListView control with LVS_REPORT causing application crash
问题描述
我正在使用WTL创建listview控件,如下所示
I am creating a listview control using WTL as below
hwnd = CWindowImpl<ListView, CListViewCtrl>::Create(0, rcDefault, _T("Parameters"),
WS_VISIBLE|LVS_REPORT|LVS_SHOWSELALWAYS|TVS_TRACKSELECT, WS_EX_TOOLWINDOW);
背景:我有一个包含各种dll的MFC可执行应用程序。这段代码是完全使用WTL支持编写的dll的一部分。这个dll有一个包含一个TreeViewCtrl和一个ListViewCtrl的窗口。
这段代码在windows7和winXP两台机器上运行良好。最近,我们使用与Visual Studio 2010捆绑在一起的最新版MFC升级了我们的项目,并且支持Office Ribbon。
现在这些更改后,我的应用程序正常运行Windows7但在Winodws XP上失败了。我在一个ATL文件中调试并找出了stackoverflow异常。重要的是,如果我在没有LVS_REPORT视图的情况下创建此listview控件。它的启动和正常工作。
到目前为止,我还没有得到任何线索,为什么会发生这种情况?任何想法的任何线索将不胜感激。
提前致谢。
Background: I am having one MFC executable application containing various dll. This piece of code is a part of the dll having totally written using WTL support. This dll is having one window containing one TreeViewCtrl and one ListViewCtrl.
This piece of code was working fine on windows7 and winXP both machines earlier. Recently we upgraded our project with the latest version of MFC bundled with visual studio 2010 and which is having Office Ribbon support.
Now after these changes my application is running properly on Windows7 but failing on Winodws XP. I debugged and figured out stackoverflow exception in one of ATL file. Importantly if i am creating this listview control without LVS_REPORT view. its launching and working properly.
So far i am not getting any clue why is it happening? Any clue any idea will be appreciated.
Thanks in advance.
推荐答案
样式标签TVS_TRACKSELECT
是0x0200,相当于LVS_EX_REGIONAL
,如 http://msdn.microsoft.com/en-gb/library/windows/desktop/bb774732(v = vs.85)。 aspx [ ^ ]。
The style tagTVS_TRACKSELECT
is 0x0200 which equates toLVS_EX_REGIONAL
as described in http://msdn.microsoft.com/en-gb/library/windows/desktop/bb774732(v=vs.85).aspx[^].
感谢理查德的解决方案。但我已经逐一尝试了所有可能的组合。即使我尝试仅使用LVS_REPORT创建此列表视图,但这也失败了。
Thanks Richard for your solution. But I have tried all the possible combination one by one. Even I have tried creating this listview only with LVS_REPORT and this was also failing.
这篇关于使用LVS_REPORT的ListView控件导致应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!