<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>You can't delete this item at this stage as its
used for other methods internally fired with the drag drop event.
Instead try something like this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>1. replace oldcb.free with postmessage
e.g.</FONT></DIV>
<DIV><FONT face=Arial
size=2>postmessage(self.handle,wm_user+1,0,0);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>2. Declare in the CheckGroup Object a new method
receiving your message. e.g.</FONT></DIV>
<DIV><FONT face=Arial size=2>procedure DeleteSomething(var Message: TMessage);
message WM_user+1;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>3. Setup the Method and move the lines beneath the
oldcb.free into it. e.g.</FONT></DIV>
<DIV><FONT face=Arial size=2>procedure TCheckGroup.DeleteSomething(var Message:
TMessage);<BR>begin<BR> if assigned(freeob) then
begin</FONT></DIV>
<DIV><FONT face=Arial size=2>
freeandnil(freeob);<BR>
ArrangeCheckBoxList;<BR> FUpdating :=
False;<BR> e</FONT><FONT face=Arial size=2>nd;</FONT></DIV>
<DIV><FONT face=Arial size=2>end;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Code not great but gives you the idea.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Matt.</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=ross@stationplaylist.com href="mailto:ross@stationplaylist.com">Ross
Levis</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=delphi@ns3.123.co.nz
href="mailto:delphi@ns3.123.co.nz">NZ Borland Developers Group - Delphi
List</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, September 30, 2004 9:58
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [DUG] TCheckGroup</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>Hi David and everyone.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I got around the BeginDrag method causing a
premature tick in a CheckBox. I have a more serious problem now which
I've been trying to solve for several hours but I'm not getting
anywhere.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm getting either an access violation or an
"Abstract Error" when dragging checkboxes in the CheckGroup. In my
larger program, it actually works fine for 1 or 2 drags, but the
next one produces the error. In the test program, it occurs every
time.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The error is occuring in the System.GetDynaMethod
assember code which doesn't help me much. Here is a download of
the component and a small test program. I hope someone can
help.</FONT></DIV>
<DIV><A href="http://www.stationplaylist.com/ChkGroup.zip"><FONT face=Arial
size=2>http://www.stationplaylist.com/ChkGroup.zip</FONT></A></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Compile, run, and drag one item onto
another to produce the error.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In the cbDragDrop procedure, a copy of the
dragged checkbox details (CBOld) is inserted at the drop location, and
then the dragged checkbox is freed. </FONT><FONT face=Arial size=2>The
error does not occur if I remark out the line: OldCB.Free. Perhaps
the freed checkbox is being accessed somewhere but I can't establish
where. I've tried break points in every
procedure/function.<BR></DIV></FONT>
<DIV><FONT size=2><FONT face=Arial><FONT size=+0>It's a little messy with the
TList and TStringList being used together but I'll clean that up
later.</FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT
size=+0></FONT></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial><FONT size=+0>Many
thanks,</FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT
size=+0>Ross.</DIV></FONT></FONT></FONT>
<P>
<HR>
<P></P>_______________________________________________<BR>Delphi mailing
list<BR>Delphi@ns3.123.co.nz<BR>http://ns3.123.co.nz/mailman/listinfo/delphi<BR></BLOCKQUOTE></BODY></HTML>