mity / mctrl

C library providing set of additional user interface controls for Windows, intended to be complementary to standard Win32API controls from USER32.DLL and COMCTL32.DLL.
http://mctrl.org
235 stars 52 forks source link

TreeList: Select item in a non MC_TLS_MULTISELECT control #42

Closed Bugzero71 closed 8 years ago

Bugzero71 commented 8 years ago

First of all thanks for this great control library.

I'm using TreeList control without enabling multiselection. When I try to send a MC_TLM_SETITEMW to select an item manually I get an assertion caused by line 1734 in file treelist.c (release-0.11.1):

MC_ASSERT(tl->style & MC_TLS_MULTISELECT);

The control works correctly instead. Is this the best way to select an item from source?

Thanks

Jordi L.

mity commented 8 years ago

Yes, it is definitely the right way how to change the selection from a program.

However it is clearly broken. I'll take a look at it over the weekend and likely release a hotfix version as this seems as a quite serious issue and there is no easy workaround.

Thanks for reporting it.

Bugzero71 commented 8 years ago

Thanks for your answer.

Now, I'm using DLL Release version as it works perfectly as expected. Probably this line is not needed as I can't detect any other issues.

mity commented 8 years ago

It may cause glitches with the 0.11.1. Given the nature of the bug, it likely can result in having more then one item selected as if having the style MC_TLS_MULTISELECT enabled.

mity commented 8 years ago

@Bugzero71: Could you please test it with your code? Feel free to reopen if it does not fix it.

(You may pick up the binaries at https://ci.appveyor.com/project/mity/mctrl/branch/master once the build finishes if you don't want to build manually.)

Bugzero71 commented 8 years ago

@mity: Thank you very much with this hotfix.

I've updated my HEAD to '213c2dc' and compiled both configurations (Debug & Release). It works fine now.

I'll be using your great library and try to help you finding bugs or solving them if I can.