Windows Structure under FiveWin

Windows Structure under FiveWin

Postby Jimmy » Tue Oct 18, 2022 12:58 am

hi,

i got now Notify Event LVN_GETDISPINFO and have Problem with next Structure NMLVDISPINFOx
i understand that i have to make a CLASS for every Structure but how when point to "Sub"-Structure ?

Code: Select all  Expand view
METHOD OnDISPINFO(nOption)

   st := NMLVDISPINFONEW():New()
   // use "Sub"-Structure
   st:item:pszText     := REPLICATE(CHR(0),255)
   st:item:cchTextMax  := 255

   // ZERO-based :iItem and :iSubItem
   nRec := st:item:iItem              // Array ZERO-based+1
   nSub := st:item:iSubItem+1

st:item point to LVITEM Structure so i need to call another CLASS ...

https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlvdispinfoa
Code: Select all  Expand view
typedef struct tagLVDISPINFO {
  NMHDR   hdr;
  LVITEMA item;
} NMLVDISPINFOA, *LPNMLVDISPINFOA;


https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlvdispinfow
Code: Select all  Expand view
typedef struct tagLVDISPINFOW {
  NMHDR   hdr;
  LVITEMW item;
} NMLVDISPINFOW, *LPNMLVDISPINFOW;


it will be a long Way when i have to write a CLASS with Method and HB_FUNC() for each Structure

---

under Xbase++, using OT4XB, i can use OOP Style without write a CLASS and Method

OT4Xb does NOT use direct "Windows" Structure, you must define each Structure
OT4XB have already a lot "own" (WAPIST) Structure, made by Pablo Botella Navarro

Code: Select all  Expand view
g:\REIN\XBASE\Pablo\source\winapi_CommonStructures.cpp

#define _XBST_NMLVDISPINFO( name )                    pc->Child( #name , "WAPIST_NMLVDISPINFO");
#define _XBST_NMHDR( name )                           pc->Child( #name , "WAPIST_NMHDR");
#define _XBST_LVITEM( name )                          pc->Child( #name , "WAPIST_LVITEM");

XB_BEGIN_STRUCTURE( NMLVDISPINFO )
   _XBST_NMHDR( hdr )
   _XBST_LVITEM( item )
XB_END_STRUCTURE

XB_BEGIN_STRUCTURE( NMRBAUTOSIZE      )
   _XBST_NMHDR ( hdr      )
   _XBST_BOOL  ( fChanged )
   _XBST_RECT  ( rcTarget )
   _XBST_RECT  ( rcActual )
XB_END_STRUCTURE

XB_BEGIN_STRUCTURE( LVITEM )
   _XBST_UINT( mask )
   _XBST_int( iItem )
   _XBST_int( iSubItem )
   _XBST_UINT( state )
   _XBST_UINT( stateMask )
_XBST_LPSTR_DYNSZ( pszText , cText)
   _XBST_int( cchTextMax )
   _XBST_int( iImage )
   _XBST_LPARAM( lParam )
   _XBST_int( iIndent )
   _XBST_int( iGroupId )
   _XBST_UINT( cColumns )
   _XBST_POINTER32( puColumns )
   _XBST_POINTER32( piColFmt )
   _XBST_int( iGroup )
XB_END_STRUCTURE


btw.
Code: Select all  Expand view
_XBST_LPSTR_DYNSZ( pszText , cText)

i can use a "normal" String for "pszText" without using "cchTextMax" ( = LEN(cText) )

can we make in FiveWin something similar like OT4XB :?:
it would reduce Work to define only Structure and than can use OOP insead of HB_FUNC()
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 112 guests