Y
yans7936
Guest
We have been doing some development using the CListCtrl Class. Things are working fine in Windows 7 but it is giving some strange behavior in Windows 10 os. I am trying to achieve something very simple here.
I have a function let’s say funSelect the code snippet looks like this
//this Function is trying to copy the selected column holding by the CListCtrl object
funcSelect()
{
/* The first Step where I am calling the GetSelectedColumn() function to get the selected column which is part of the CListCtrl class */
iselectedCoulmn = CListCtrlObj.GetSelectedColumn();
We are seeing a problem with the above GetSelectedColumn(). I haven't selected any column and still as a return value it is giving me as 0 ( Which means that a column has been selected, which is clearly not the case) Also in windows 7 for the same piece of code we can see the return value is -1 ( which is right cause nothing has been selected)
The rest of the logic is written based on the return value of -1. In other words, if nothing is selected then how are we treating the code. As mentioned above the code has been working properly in Windows 7 and doing the expected job. But in Windows 10 because we are getting the return value as 0 that part of the code is not hitting at all.
}
I did check all the settings like manifest file and using ComCtl32.dll version 6, Also it is using SDK Ver 10 and I have checked the VS2015 set up I can see all the SDK includes are properly set up. So all these things are in place.
Can someone please throw Some light why this API GetSelectedColumn(); is returning 0 instead of - 1. Has anything changed for this API for <g class="gr_ gr_89 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation multiReplace" data-gr-id="89" id="89">Windows10.</g>
The correct behavior is it should get -1 when no column is selected. Even the MSDN documents say that. or is there any alternative way of achieving the GetSelectedColumn(); but more in platform independent and generic way? Any function or Code snippet will highly help.
Also as an FYI in the manifest <g class="gr_ gr_83 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" data-gr-id="83" id="83">file</g> we did introduce the compatibility tag so that it can call the native API, but even after that there is no change in GetSelectedColumn() return value. It still returns 0 instead of -1.
Just as an FYI the below has been added into the manifest files
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
I will really appreciate if some can throw more light on this and if somebody has encountered the same issue then how did they resolve it. Any snippet or Function which one can do the job please let me know. I will really appreciate if I can get some reply at the earliest
Thanks - Yan
Continue reading...
I have a function let’s say funSelect the code snippet looks like this
//this Function is trying to copy the selected column holding by the CListCtrl object
funcSelect()
{
/* The first Step where I am calling the GetSelectedColumn() function to get the selected column which is part of the CListCtrl class */
iselectedCoulmn = CListCtrlObj.GetSelectedColumn();
We are seeing a problem with the above GetSelectedColumn(). I haven't selected any column and still as a return value it is giving me as 0 ( Which means that a column has been selected, which is clearly not the case) Also in windows 7 for the same piece of code we can see the return value is -1 ( which is right cause nothing has been selected)
The rest of the logic is written based on the return value of -1. In other words, if nothing is selected then how are we treating the code. As mentioned above the code has been working properly in Windows 7 and doing the expected job. But in Windows 10 because we are getting the return value as 0 that part of the code is not hitting at all.
}
I did check all the settings like manifest file and using ComCtl32.dll version 6, Also it is using SDK Ver 10 and I have checked the VS2015 set up I can see all the SDK includes are properly set up. So all these things are in place.
Can someone please throw Some light why this API GetSelectedColumn(); is returning 0 instead of - 1. Has anything changed for this API for <g class="gr_ gr_89 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation multiReplace" data-gr-id="89" id="89">Windows10.</g>
The correct behavior is it should get -1 when no column is selected. Even the MSDN documents say that. or is there any alternative way of achieving the GetSelectedColumn(); but more in platform independent and generic way? Any function or Code snippet will highly help.
Also as an FYI in the manifest <g class="gr_ gr_83 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" data-gr-id="83" id="83">file</g> we did introduce the compatibility tag so that it can call the native API, but even after that there is no change in GetSelectedColumn() return value. It still returns 0 instead of -1.
Just as an FYI the below has been added into the manifest files
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
I will really appreciate if some can throw more light on this and if somebody has encountered the same issue then how did they resolve it. Any snippet or Function which one can do the job please let me know. I will really appreciate if I can get some reply at the earliest
Thanks - Yan
Continue reading...