Still pursuing a solution to my ListView problem, I'm having mild forms of success by using a Win32::GUI::Header placed on top of the default header created by ListView->InsertColumn.

Alas, all dedicated Win32::GUI::Header events (BeginTrack, EndTrack, Track, DividerDblClick, ItemClick and ItemDblClick) fail to work as the XS code is never reached. The root cause of this seems to be the negative API event numbers starting at -300 (HDN_FIRST).

I'm using Strawberry Perl 5.16 and the MingW commctrl.h header file defines this as:

#define HDN_FIRST (0U-300U)

I found by debugging the XS that the cases in the switch statement

switch (nmh->hdr.code) { case HDN_BEGINTRACK :

never match. Replacing e.g. HDN_BEGINTRACK with the numeric "-326" makes it work. Now, I can brute-force things by inserting

#define HDN_FIRST -300 #define HDN_BEGINTRACK (HDN_FIRST-26)

into Header.xs and live with the compiler warnings. But that's just ugly.

Another workaround would be using the standard events "onMouseDown", "onMouseUp" etc. and compute the relevant information. But that seems ugly, too.

I'm not a C person and therefore wonder if there's a way to tell gcc to compile "0U-300U" into something that ends up being effectively -300 in the object code.

Any hints on how to deal with this? Should I file a bug report with the maintainers?


In reply to Hints on compiling Win32::GUI::Header by tomsell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.