Ejoc Posted March 11, 2007 Share Posted March 11, 2007 Is there a destructor being called to free a DllStruct if the variable returned from DllStructCreate is set to equal another DllStructCreate? I'm trying to create a link listed, which should be possible using DllStructCreate, but something is not working as I'm expecting it too: expandcollapse popup$sNode = "int;int;int;ptr" $node = DllStructCreate($sNode) If @Error Then MsgBox(0,"","node = DllStructCreate(sNode)") EndIf $node_ptr = DllStructGetPtr($node) DllStructSetData($node,1,1) DllStructSetData($node,4,0) $NodeHead_ptr = $node_ptr $NodeHead = DllStructCreate($sNode,$NodeHead_ptr) If @Error Then MsgBox(0,"","NodeHead = DllStructCreate(sNode,NodeHead_ptr)") EndIf MsgBox(0,"", "node(" & $node_ptr & ") = " & DllStructGetData($node,1) & " " & DllStructGetData($node,4) & @CRLF & _ "NodeHead(" & $NodeHead_ptr & ") = " & DllStructGetData($NodeHead,1) & " " & DllStructGetData($NodeHead,4)) $node = DllStructCreate($sNode) If @Error Then MsgBox(0,"","node = DllStructCreate(sNode)") EndIf $node_ptr = DllStructGetPtr($node) DllStructSetData($node,1,2) DllStructSetData($node,4,0) $NodeHead = DllStructCreate($sNode,$NodeHead_ptr) If @Error Then MsgBox(0,"","NodeHead = DllStructCreate(sNode,NodeHead_ptr)") EndIf DllStructSetData($NodeHead,4,$node_ptr) MsgBox(0,"", "node(" & $node_ptr & ") = " & DllStructGetData($node,1) & " " & DllStructGetData($node,4) & @CRLF & _ "NodeHead(" & $NodeHead_ptr & ") = " & DllStructGetData($NodeHead,1) & " " & DllStructGetData($NodeHead,4)) $node = DllStructCreate($sNode) If @Error Then MsgBox(0,"","node = DllStructCreate(sNode)") EndIf $node_ptr = DllStructGetPtr($node) DllStructSetData($node,1,3) DllStructSetData($node,4,0) $NodeHead = DllStructCreate($sNode,$NodeHead_ptr) If @Error Then MsgBox(0,"","NodeHead = DllStructCreate(sNode,NodeHead_ptr)") EndIf MsgBox(0,"", "node(" & $node_ptr & ") = " & DllStructGetData($node,1) & " " & DllStructGetData($node,4) & @CRLF & _ "NodeHead(" & $NodeHead_ptr & ") = " & DllStructGetData($NodeHead,1) & " " & DllStructGetData($NodeHead,4)) Results: node(6099336) = 1 0 NodeHead(6099336) = 1 0 -As Expected node(6101672) = 2 0 NodeHead(6099336) = 1 6101672 -As Expected node(6101112) = 3 0 NodeHead(6099336) = 153 5832864 -Not Expected Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now