* This is a separate prg file named cIList. >DEFINE CLASS cImageList AS OLECONTROL > .Height = 45 > .Left = 141 > .Top = 145 > .Width = 52 >ENDDEFINE >* This is the code for the subclassed TreeView in CTView.prg >DEFINE CLASS CTreeView AS OLECONTROL > #INCLUDE TreeView.h > > .Object.Appearance = 1 > .Object.BorderStyle = 0 > .Object.Height = 185 > .Object.Indentation = 20 > .Object.LabelEdit = tvwManual > .Object.Left = 12 > .Object.LineStyle = tvwTreeLines > .Object.MousePointer = 0 > .Object.OLEDragMode = 0 > .Object.OLEDropMode = 0 > .Object.Style = tvwTreelinesPlusMinusPictureText > .Object.Top = 12 > .Object.Width = 150 > > Height = 185 > Left = 12 > Top = 12 > Width = 150 > > PROCEDURE Click > > This.Parent.DisableCk.Refresh > ENDPROC >ENDDEFINE >* This is the method code in the class library >IF "6." $ VERSION() > lctreeclass = "MSComctlLib.Treectrl.2" > lcimageclass = "MSComctlLib.ImageListCtrl.2" >ELSE > lctreeclass = "COMCTL.Treectrl.1" > lcimageclass = "COMCTL.ImageListCtrl.1" >ENDIF >SET PROCEDURE TO cIList ADDITIVE >* VFP Reports a Syntax error here first >* On second attempt a C0000005 error occurs. >This.AddObject('ObjImages', "cImageList", lcimageclass) >* This does not (Note: SET PROCEDURE line removed) >This.AddObject('ObjImages', "OLEControl", lcimageclass) >* The following works fine. >WITH This.ObjImages > .Height = 45 > .Left = 141 > .Top = 145 > .Width = 52 > .MaskColor = 16777215 > .ImageHeight = 16 > .ImageWidth = 17 > .MaskColor = .T. > FOR lni = 0 TO 17 > .ListImages.Add(,,ThisForm.CtrlPicClip.GraphicCell(lni)) > NEXT >ENDWITH >SET PROCEDURE TO CTView ADDITIVE >This.AddObject('ObjTree', "CTreeView", lctreeclass) >WITH This.ObjTree > .Font.Name = "MS Sans Serif" > .Font.Size = 8.25 > .ImageList = ThisForm.ObjImages.Object > .Visible = .T. >ENDWITH>I hasten to point out that this was done in VFP 6.0.