In the procedure TMainForm.FormCreate, the call to
SetEditorMode (mTile) causes a TMainForm.FormResize
when the ScrollBox.Align is set to alClient. The
FormResize calls UpdateBmp (TRUE) which accesses the
Bmp before it has been created causing AV.
Calltree:
> [procedure FormCreate]
> SetEditorMode (mTile);
>> [procedure SetEditorMode]
>> ScrollBox.Align = alClient;
>>> [procedure FormResize]
>>> UpdateBmp (TRUE);
>>>> [procedure UpdateBmp]
>>>> Canvas.CopyRect (Rect (0, 0, W, H), Bmp.Canvas,
MakeRect (BORDER_W, BORDER_H, W, H));
***Access Violation***
Because Bmp is nil. One solution is to call
SetEditorMode (mTile) later. eg. after
CreateNewTileCollection().
Logged In: YES
user_id=258029
I haven't been able to reproduce this AV (I'm also running
XP), but I'm moving the call to where you suggested.