Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CTreeViewCtrl
Message
From
02/06/2005 00:20:44
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
CTreeViewCtrl
Miscellaneous
Thread ID:
01019236
Message ID:
01019236
Views:
170
Hi all,

I'm trying to use the cTreeViewCtrl class. Seems like it should be simple enough, however, when the class goes through the Init method it throws me an error at the "This.TreeView.Object.ImageList = This.Imagelist.Object" line.

The error is:
#1429 - OLE IDispatch exception code 0 from TreeCtrl: ImageList must be initialized before it can be used.

The AddImageList method is called earlier so I'm assuming the ImageList is initialized. How do I check or verify that it is in fact initialized? Any ideas on solving this one?

Here's the Init code in it's entirety for reference (this is the code included with the MM Framework, it is untouched)
*---------------------- Location Section ------------------------
*   Library: CActiveX.vcx
*   Class:   CTreeViewBaseCtrl
*   Method:  Init()
*----------------------- Usage Section --------------------------
*)  Description: 
*)		Adds the ImageList and TreeView controls to the 
*)		CTreeViewBaseCtrl container.

*   Scope:      
*   Parameters: 
*$  Usage:      
*$              
*   Returns:  .F. if errors were encountered instantiating
*				the TreeView or ImageList objects. Otherwise .T.
*--------------------- Maintenance Section ----------------------
*
*   Change Log:
*       CREATED 	06/01/98 - KJM
*		MODIFIED	06/18/98 - QBT
*			Ignore the return value of This.AddImageList()
*		MODIFIED	03/16/99 - KJM
*			Fixed a typo in the code that determines if the 
*			ImageList control successfully instantiated
******************************************************************
LOCAL llRetVal

*------------------------------------------------------
*-- Do not allow this class to be directly instantiated
*------------------------------------------------------
IF IsAbstract(This.Class, 'CTreeViewBaseCtrl')
  RETURN .F.
ENDIF

*-------------------------------------------
*--- Add the ImageList and TreeView controls
*-------------------------------------------
This.AddImageList()
llRetVal = This.AddTreeView()
IF llRetVal
	*------------------------------------------------
	*--- Set the TreeView control's dimensions to the
	*--- height/width of the CTreeViewBaseCtrl container
	*------------------------------------------------
	This.TreeView.Height = This.Height
	This.TreeView.Width = This.Width

	*----------------------------------------------
	*--- Store an object reference to the ImageList
	*--- in the TreeView's ImageList property
	*----------------------------------------------
	IF TYPE('This.ImageList') == 'O' 
		This.TreeView.Object.ImageList = ;
		  This.Imagelist.Object
	ENDIF
ENDIF

RETURN llRetVal
Next
Reply
Map
View

Click here to load this message in the networking platform