[lazarus] Sniffing Synedit Tokens
Hi when a Var parameter is to be passed, holding a TPersistent object like below (tmpattr)... syn1.GetHighlighterAttriAtRowCol(syn1.CaretXY, tmpstring, tmpattr); ..is it wrong to create tmpattr first? Is it just a reference to an existing TSynHighlighterAttributes When I create and free a storage 'tmpattr' I get access violation and this is why I'm wondering. _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Sniffing Synedit Tokens
On 3/11/06, L505 [EMAIL PROTECTED] wrote: Hi when a Var parameter is to be passed, holding a TPersistent object like below (tmpattr)... syn1.GetHighlighterAttriAtRowCol(syn1.CaretXY, tmpstring, tmpattr); ..is it wrong to create tmpattr first? Is it just a reference to an existing TSynHighlighterAttributes When I create and free a storage 'tmpattr' I get access violation and this is why I'm wondering. Actually, the parameter coud/should be 'out' (but I guess FPC doesn't even implement the COM-ish things ;-) It has nothing to do with 'var' and 'TPersistent', the problem is the object returned in 'tmpattr' the actual object owned by the highlighter, so if you free it this will generate an AV the next time the highlighter is used (e.g. the editor is painted). -Flávio _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Sniffing Synedit Tokens
On Sat, 11 Mar 2006, Flávio Etrusco wrote: On 3/11/06, L505 [EMAIL PROTECTED] wrote: Hi when a Var parameter is to be passed, holding a TPersistent object like below (tmpattr)... syn1.GetHighlighterAttriAtRowCol(syn1.CaretXY, tmpstring, tmpattr); ..is it wrong to create tmpattr first? Is it just a reference to an existing TSynHighlighterAttributes When I create and free a storage 'tmpattr' I get access violation and this is why I'm wondering. Actually, the parameter coud/should be 'out' (but I guess FPC doesn't even implement the COM-ish things ;-) 'out' is implemented and used. Michael.
Re: [lazarus] Sniffing Synedit Tokens
Actually, the parameter coud/should be 'out' (but I guess FPC doesn't even implement the COM-ish things ;-) 'out' is implemented and used. Michael. I've used it before :) _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives