TAdvCheckedTreeView assign

Hello
I am using TAdvCheckedTreeview and am editing nodes. So the user can cancel changes to the node, i would like to store a copy of the node in another node where ANode is the original and copyNode is the edit.

copyNode.Assign(ANode)
...do things here with copy node.
copyNode....

if I try to assign ANode to copyNode again, I get an exception exception class $C0000000005 with message 'C0000000005 ACCESS_VIOLATION'

is there a way to reset the copyNode like free and reinitialize it? is there a better way to accomplish the Assign?

thanks
Doug


Hi, 


Can you perhaps provide the source code that handles this so we can investigate what exactly is missing?

Thanks

With some help from suport (Pieter) I believe I was not initializing Node variables correctly, however with the suggested solution, I get the same error on the initialization of the variable localNode:

procedure EditNode(ANode: TAdvCheckedTreeViewNode);

var

  localNode: TAdvCheckedTreeViewNode;

begin

localNode := TAdvCheckedTreeViewNode.Create(nil);  ///$$$$$$ ERROR!

localNode.Assign(ANode);

//make changes or cancel changes to localNode

ANode.Assign(localNode);

localNode.Free;

end;

Any suggestions? If I comment out the localNode.Create(nil), the localNode.Free does not error.


thnx


We have further investigated this here and there are some missing Assign checks in the treeview source that prevents the use of a nil parameter passed to the constructor of a TAdvCheckedTreeViewNode. We have applied fixes that will be available in the next release and will allow to create a node with a nil parameter. For urgent fixes, please contact us by direct email