๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1121

Re: Something is missing in the NMLVCUSTOMDRAW struct

#1121
From: Remy Lebeau (TeamB)
Date: Wed, 24 Oct 2007 16:34
68 lines
2917 bytes
"Asger J๏ฟฝrgensen" <junk@Asger-P.dk> wrote in message 
news:MPG.21896e1eb0f218c5989879@newsgroups.borland.com...

> The NMLVCUSTOMDRAW struct are defined as folows
> on the msdn web:

That declaration is not accurate.  Look at the actual declaration in 
commctrl.h instead:

typedef struct tagNMLVCUSTOMDRAW
{
    NMCUSTOMDRAW nmcd;
    COLORREF clrText;
    COLORREF clrTextBk;
#if (_WIN32_IE >= 0x0400)
    int iSubItem;
#endif
#if (_WIN32_WINNT >= 0x501)
    DWORD dwItemType;

    // Item custom draw
    COLORREF clrFace;
    int iIconEffect;
    int iIconPhase;
    int iPartId;
    int iStateId;

    // Group Custom Draw
    RECT rcText;
    UINT uAlign;      // Alignment. Use LVGA_HEADER_CENTER, 
LVGA_HEADER_RIGHT, LVGA_HEADER_LEFT
#endif
} NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;

> but when I set a watch at rcText I'm told that
> it is not a member of NMLVCUSTOMDRAW

Notice in the declaration above that rcText is wrapped inside an #if 
statement.  _WIN32_WINNT is defined in winresrc.h as 0x500 by default, thus 
it does not satisfy the condition of the #if statement unless you re-define 
_WIN32_WINNT yourself in the Conditionals list of the Project Options 
dialog.

> i look in commctrl.h and there I see this

You must be using an old version of BCB then.  The declaration above was 
copied from commctrl.h in BCB 6.

> I try to fill in the missing part
>  DWORD dwItemType;
>  RECT rcText;
>  UINT uAlign;
>
> so now it dont get the message in the watch list
> but there is nothing meaningfull in the RECT.

That is because you did not include everything that is missing.  As you can 
see above, there are 5 other members between dwItemType and rcText that must 
be present in order to align rcText correctly in memory.

> Is there a special trick to get those ??

Upgrade to a newer BCB version, or at least download a newer Platform SDK 
from Microsoft so you have newer header files.


Gambit 
Technical Details
Message-ID: <471f7462@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <MPG.21896e1eb0f218c5989879@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8ff79edc31b9843c
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <MPG.21896e1eb0f218c5989879@newsgroups.borland.com>
Subject: Re: Something is missing in the NMLVCUSTOMDRAW struct
Date: Wed, 24 Oct 2007 09:34:55 -0700
Lines: 70
Organization: Lebeau Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 207.178.157.90
Message-ID: <471f7462@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1193243746 207.178.157.90 (24 Oct 2007 09:35:46 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail