Print Page | Close Window

Embedding CCJTreectrl in CTreeView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: General Discussion
Forum Description: Topics Related to Visual C++ MFC Development in General
URL: http://forum.codejock.com/forum_posts.asp?TID=335
Printed Date: 29 April 2024 at 9:58am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Embedding CCJTreectrl in CTreeView
Posted By: huw.edwards
Subject: Embedding CCJTreectrl in CTreeView
Date Posted: 06 January 2004 at 5:58am

Hi

Has anyone tried using the treectrl in a ctreeview (or is this stupid?)

I can use the CJ tree ctlr in my treeview with

 CCJTreeCtrl* m_pTreeCtrl = (CCJTreeCtrl*) &GetTreeCtrl();

and it works fine until I try to use the extra functionality with

 m_pTreeCtrl->EnableMultiSelect(TRUE);

at that point I get :
File: i386\chkesp.c
Line: 42
The value of ESP was not properly saved across a function call. [..]

I've tried switching to different calling conventions (__stdcall, __cdecl) with no effect.

Is it possible to embed a CJ tree ctrl in a tree view ?

Thanks Huw

 

 

 




Replies:
Posted By: thodgson
Date Posted: 01 April 2004 at 2:23pm

I reinstalled my OS, VC 6.0, Xtreme Toolkit 8.61 Pro, Platform SDK.  I did a rebuild all on my program.  I ran my program and got a similar error.

On another machine, I don't get the error...not sure why, but the answer is in the differences.

If I find out what is causing this, I'll let you know. 

 



Posted By: thodgson
Date Posted: 02 April 2004 at 8:02am

Okay.  In my particular case, I had copied the XT Pro dll from one machine to another and tried to run my program using that dll (wrong).  I instead copied the dll which was built on the same machine, to my program's bin directory, ran the program, and the error went away.

Hopefully this information will help you in some way.

Tim



Posted By: spike
Date Posted: 12 April 2004 at 6:44pm

This breaks the laws of C++. The object would have to be allocated as a "CCJTreeCtrl" in order to call methods that are *in* "CCJTreeCtrl".

All you have done is cast a CTreeCtrl* to a CCJTreeCtrl, that does not automatically give you access to everything in CCJTreeCtrl.

I would suggest you use CXTTreeView. 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net