https://www.codeproject.com/Articles/98 ... -Applicati
und so kommt man nun an den Artikel https://www.codeproject.com und dann mit suchen
Code: Alles auswählen
"How to Subclass Unicode Window from ANSI Applicati"
bei dem Listview Group Modul hatte ich Probleme mit der "Beschriftung" welche in Unicode erfolgen sollte.
Code: Alles auswählen
#xtranslate L(<c>) => cSzAnsi2Wide(<c>)
::pszHeader := L(cHeader)
::cchHeader := LEN( L(cHeader))
Code: Alles auswählen
_XBST_POINTER32 ( pszHeader ) // LPWSTR
_XBST_int ( cchHeader )
// Antwort von Pablo
here I was interpreted just a generic pointer because not in all
contexts is safe to do automatic conversions and allocation
I sugest you just use your own subclassjust remember to group:cHeader := NIL at the end to deallocate the memoryCode: Alles auswählen
CLASS dxe_LVGROUP FROM WAPIST_LVGROUP EXPORTED: VAR pHeaderBuffer INLINE CLASS METHOD initclass ; return Self // initclass required for gwst inheritance INLINE ACCESS ASSIGN METHOD cHeader(v) local p,cb,cc if pcount() > 0 if !empty( ::pHeaderBuffer ) _xfree( ::pHeaderBuffer ) ::pHeaderBuffer := 0 end ::pszHeader := 0 ::cchHeader := 0 if !(__vstr(v) == NIL) ::pszHeader := ; ::pHeaderBuffer := ; @ot4xb:mb2w(v,len(v),@Self:cchHeader,0,0) end return NIL end if lAnd( ::pszHeader ) if lAnd( ::cchHeader ) cb := 0 p := @ot4xb:_w2mb( ::pszHeader , ::cchHeader,@cb,0,0) if lAnd(p) cc := PeekStr(p,0,cb) _xfree(p) return cc end end return "" end return NIL // ------------------- ENDCLASS