maul-esel/COM-Classes — Issue #46: CCF (V2) and ObjTree makes AHK V2 crash ...
Author: hoppfrosch
Created: 2012-02-29 06:29:48+00:00
State: open

After fixing an error (http://www.autohotkey.com/forum/viewtopic.php?p=517398#517398) , which allows using ObjTree to display objects from CCF, still one fatal error exists:

At the end of the following example program, AHK2 crashes and pops up a window (german OS): "Autohotkey_L funktioniert nicht mehr".

```autohotkey
#SingleInstance
#include ..\..\_CCF_Error_Handler_.ahk
#include ..\..\CCFramework.ahk
#Include ..\..\Unknown\Unknown.ahk
#Include ..\..\ShellItem\ShellItem.ahk
#Include ..\..\Constant Classes\SIGDN.ahk
#Include ..\..\Constant Classes\SFGAO.ahk
#Include ..\..\Constant Classes\KNOWNFOLDERID.ahk

; #############################################
; Explicit filepath
shItem := ShellItem.FromAbsolutePath(A_AhkPath)

ObjTree(shItem)

; display a few names
MsgBox % "NORMALDISPLAY: <" shItem.GetDisplayName() ">`nFILESYSPATH: <" shItem.GetDisplayName(SIGDN.FILESYSPATH) ">`nDESKTOPABSOLUTEEDITING: <" shItem.GetDisplayName(SIGDN.DESKTOPABSOLUTEEDITING) ">`nPARENTRELATIVEFORADDRESSBAR: <" shItem.GetDisplayName(SIGDN.PARENTRELATIVEFORADDRESSBAR) ">"

; checking some attributes
ret := shItem.GetAttributes((SFGAO.HASPROPSHEET | SFGAO.ENCRYPTED | SFGAO.FOLDER | SFGAO.BROWSABLE), bits)
; to display wheter the flag is set or not, we use Utility function - or some bitwise operations
MsgBox % "HASPROPSHEET: <" CCFramework.HasEnumFlag(bits, SFGAO.HASPROPSHEET) ">`nENCRYPTED: <" CCFramework.HasEnumFlag(bits,SFGAO.ENCRYPTED) ">`nFOLDER: <" ((bits & SFGAO.FOLDER) > 0) ">`nBROWSABLE: <" ((bits & SFGAO.BROWSABLE) > 0) ">"
```

I'm not quite sure, who's the culprit (either CCF, ObjTree, or AHK itself) - but it's beyond my capability to identify it ...