![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Invalid typecast [D6, WinXP]
DUDAS © (2005-12-09 12:08:00)Помогите, пожалуйста...
При компиляции процедуры:
procedure TAutoCustomImageListBox.CNDrawItem(var Message: TWMDrawItem);
var
State: TOwnerDrawState;
begin
with Message.DrawItemStruct^ do
begin
State := TOwnerDrawState(WordRec(LongRec (itemState).Lo).Lo);
Canvas.Handle := hDC;
Canvas.Font := Font;
Canvas.Brush := Brush;
if (Integer(itemID) >= 0) and (odSelected in State) then
begin
Canvas.Brush.Color := clHighlight;
Canvas.Font.Color := clHighlightText
end;
if Integer(itemID) >= 0 then
DrawItem(itemID, rcItem, State) else
Canvas.FillRect(rcItem);
if odFocused in State then begin
if(FImageList <> Nil) then
InflateRect(rcItem, -2, -3);
DrawFocusRect(hDC, rcItem);
end;
Canvas.Handle := 0;
end;
end;
В строчке: State := TOwnerDrawState(WordRec(LongRec (itemState).Lo).Lo);
Ошибка " Invalid typecast".
В чем может быть проблема?
han_malign (2005-12-09 13:32:00) [1]
> State := TOwnerDrawState(LongRec(itemState).Lo);
State := TOwnerDrawState(itemState);
???
DUDAS (2005-12-09 12:26:00) [2]Спасибо!!!
Игорь Шевченко (2005-12-09 12:13:00) [3]State := TOwnerDrawState(LongRec(itemState).Lo);