[Lazarus] Carbon: GetTextExtentPoint and Access Violation

Tom Gregorovic _tom_ at centrum.cz
Mon Jun 16 11:36:29 CEST 2008


On Mon, Jun 16, 2008 at 10:53 AM, Bent Normann Olsen <bent at earmaster.com> wrote:
> Hi,
>
> At certain points our application crashes, like when a control is about to
> show a hint, and then throws an exception 'External: EXC_BAD_ACCESS', and
> breaks at line 1725 in carbonwinapi.inc: "if not CheckDC(DC,
> 'GetTextExtentPoint') then Exit;"
>
> I traced the exact crash point to line 1582 in control.inc:
> "Dispatch(TheMessage)".
>
> The GetTextExtentPoint is called 6 times currently with the same string and
> no problems, and the Dispatch is called twice after the 6th time with no
> problems, but crashes at the 3rd call to Dispatch.
>
> The TheMessage has the following parameters:
>
>  {MSG=66592, WPARAM=265482992, LPARAM=0, RESULT=0, WPARAMLO=62192,
> WPARAMHI=4050, LPARAMLO=0, LPARAMHI=0, RESULTLO=0, RESULTHI=0}
>
> I believe the WPARAM is the DC, but anybody know what MSG=66592 ($10420) is
> all about? Or have any clue of what causes the crash?

Message type is LM_PAINT.
Try to debug the CheckDC. Maybe the DC is not valid object.

Tom



More information about the Lazarus mailing list