CTreeCtrl ASSERT question?

1) Why do I get a "Debug Assertion Failed!" when I insert an item in the 
CTreeCtrl as shown below?

BOOL CDeviceProp::OnInitDialog()
{

	// TODO:  Add extra initialization here
	mDeviceTreeCtrl.InsertItem( "TEST" );

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void CDeviceProp::OnTvnSelchangedTree1(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
	// TODO: Add your control notification handler code here
	*pResult = 0;
}

2) Is it possible to use CListCtrl entirely WITHOUT icons/images?

....maybe I need a CTreeCtrl/CListCtrl explanation for dummies, for I 
can't figure it out from books/MSDN.

Thanks in adv.

Tage
0
tkn (22)
12/29/2005 11:47:05 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
769 Views

Similar Articles

[PageSpeed] 29

You need a root item first... These articles might help you:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_using_clistctrl.asp
http://www.codeproject.com/listctrl/listctrldemo.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_using_ctreectrl.asp
http://www.codeproject.com/treectrl/simptree.asp

HTH,

Tom

"Tage Korsdal Nielsen" <tkn@korsdal.dk> wrote in message 
news:uWXhsINDGHA.2644@TK2MSFTNGP09.phx.gbl...
> 1) Why do I get a "Debug Assertion Failed!" when I insert an item in the 
> CTreeCtrl as shown below?
>
> BOOL CDeviceProp::OnInitDialog()
> {
>
> // TODO:  Add extra initialization here
> mDeviceTreeCtrl.InsertItem( "TEST" );
>
> return TRUE;  // return TRUE unless you set the focus to a control
> // EXCEPTION: OCX Property Pages should return FALSE
> }
>
> void CDeviceProp::OnTvnSelchangedTree1(NMHDR *pNMHDR, LRESULT *pResult)
> {
> LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
> // TODO: Add your control notification handler code here
> *pResult = 0;
> }
>
> 2) Is it possible to use CListCtrl entirely WITHOUT icons/images?
>
> ...maybe I need a CTreeCtrl/CListCtrl explanation for dummies, for I can't 
> figure it out from books/MSDN.
>
> Thanks in adv.
>
> Tage 


0
tserface (3860)
12/30/2005 12:13:52 AM
Well, it asserted in the DoDataExchange even if I added no code. I 
deleted the dialog class and started from scratch - now it works!

I must have messed somethings up .... sorry for wasting your time with this

Thanks and a Happy Newyear!

Tage

Tom Serface wrote:

> You need a root item first... These articles might help you:
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_using_clistctrl.asp
> http://www.codeproject.com/listctrl/listctrldemo.asp
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_using_ctreectrl.asp
> http://www.codeproject.com/treectrl/simptree.asp
> 
> HTH,
> 
> Tom
> 
> "Tage Korsdal Nielsen" <tkn@korsdal.dk> wrote in message 
> news:uWXhsINDGHA.2644@TK2MSFTNGP09.phx.gbl...
> 
>>1) Why do I get a "Debug Assertion Failed!" when I insert an item in the 
>>CTreeCtrl as shown below?
>>
>>BOOL CDeviceProp::OnInitDialog()
>>{
>>
>>// TODO:  Add extra initialization here
>>mDeviceTreeCtrl.InsertItem( "TEST" );
>>
>>return TRUE;  // return TRUE unless you set the focus to a control
>>// EXCEPTION: OCX Property Pages should return FALSE
>>}
>>
>>void CDeviceProp::OnTvnSelchangedTree1(NMHDR *pNMHDR, LRESULT *pResult)
>>{
>>LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
>>// TODO: Add your control notification handler code here
>>*pResult = 0;
>>}
>>
>>2) Is it possible to use CListCtrl entirely WITHOUT icons/images?
>>
>>...maybe I need a CTreeCtrl/CListCtrl explanation for dummies, for I can't 
>>figure it out from books/MSDN.
>>
>>Thanks in adv.
>>
>>Tage 
> 
> 
> 
0
tkn (22)
12/30/2005 8:53:23 AM
It's never a waste of time to ask questions in this forum.  We all learn 
from each other's questions and even from each other mistakes.

Happy New Year to you (and others here) as well.

Tom

"Tage Korsdal Nielsen" <tkn@korsdal.dk> wrote in message 
news:OhoY95RDGHA.3984@TK2MSFTNGP14.phx.gbl...
> Well, it asserted in the DoDataExchange even if I added no code. I deleted 
> the dialog class and started from scratch - now it works!
>
> I must have messed somethings up .... sorry for wasting your time with 
> this
>
> Thanks and a Happy Newyear!
>
> Tage
>
> Tom Serface wrote:


0
tserface (3860)
12/30/2005 5:08:09 PM
Reply:

Similar Artilces:

Formatting Question
I'm using Excel 2003. I'm pasting some data from an ASP.Net datagrid into a worksheet. One column called Duration could have a value of 11:31 in it - which means 11 minutes and 31 seconds If I double click in the cell it changes to 11:31:00 AM which I don't want it to do at all. Or if I try to format it as General it gives me 0.479861111111111. Formatting as text gives me the same result. I'm confused as to why its doing this. Thanks, Jason MacKenzie Hi Jason Excel interprets your value as HH:MM and not as MM:SS Try the following: - enter the value 60 in an empty cell ...

Newbie question regarding GP Invoice drill-down
Is there a way to put an URL pointing to an image of the invoice in the invoice/payable data entry screen so that we can click on it later to view the image? Thanks Bill Bill, You can attach a document (image in this case) to Transaction Entry window by clicking on the icon that looks like a sheet of paper next to the Voucher number. Clicking on the paper clip icon in the notes window opens an OLE Container into which you can insert the image and save it. Frank Hamelly MCP-GP, MCT, MVP East Coast Dynamics www.eastcoast-dynamics.com blog: www.gp2themax.blogspot.com Bill, For more ...

selection in CTreeCtrl
Hello, I have a Tree Control in my application that displays two types of items: type A and type B. I want to implement the following: 1. When user clicks on any item of type A it should be shown as selected and the previously selected item will be deselected - it is actually the default behavior. 2. When user clicks on any item of type B - nothing should happen: the previously selected item remain selected and the clicked item remains deselected. So, actually, I want that the items of type B will never highlighted with a blue band. How can do it? Thanks, Mark. -- Please ...

Basic CFile question
Hi all, I'm trying to use CFile::Write () to write some data to a text file - a mixture of strings and (hopefully) the values stored in variables in my program. Unfortunately I cant seem to get it to write the values correctly - it writes the actual binary value which notepad then reads back as a special character. Grrrr. Ive tried using sprintf() to write it to a char buffer then write the buffer to the file but that does the same. Can anyone shed light on what, surely, should be a very simple thing to do? Thanks J Coyoteboy wrote: > Hi all, > > I'm trying to use...

UNC question
Is there a way to programatically change the unc path to all linked tables at once? -- Milton Purdy ACCESS State of Arkansas Only by using VBA to loop through the TableDefs collection and changing each one that needs to be changed. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "golfinray" <golfinray@discussions.microsoft.com> wrote in message news:1224B3F2-9E6F-4A15-87B8-8086A3C7F05A@microsoft.com... > Is there a way to programatically change the unc path to all linked tables > at > once? > -- >...

Resource RT_RCDATA (simple question)
Hi, I have a "application defined resource data" as MSDN puts it. I import it into the resource (no problems there). It gives a identifier IDR_DATA1, then IDR_DATA2 for the next one and so on. How can I change the identifier to another name? I can change it for other resource types. Also, are resources identified with a string or a integer? Functions like FindResource and FindResourceEx want a string. I am aware of MAKEINTRESOURCE, but is it possible to pass the string to FindResource directly? How can I do that? How can I know the string name of my resource? Is it "IDR_DATA1...

afxwin1.inl
I am running the debugger in VC++ 6.0. It says the assert is on the following line (27): { ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; } This happens when one of my dlls is executing. I tried adding the following as a global in the main code, but this did not help. CWinApp MyApp("xxxx"); // attempted to remove assert Also, I use multiple dlls. One of the dll's uses MFC (not the new problematic one) and is a normal dynamically linked dll. (use MFC shared dll and NO DllMain). Any ideas on how to fix the assert? TIA! Is it possible that you need to...

CURSOR_STATUS question
I was having trouble with this earlier, thought I solved it but then trouble again. I want to create the following: DECLARE crBadAdjs INSENSITIVE CURSOR FOR..... But I need to test it for CURSOR_STATUS which I don't seem to be able to do with INSENSITIVE because I don't know if it's local or global.. If I do the following, it works: IF CURSOR_STATUS('local', 'crBadAdjs') > 0 BEGIN CLOSE crBadAdjs DEALLOCATE crBadAdjs END DECLARE crBadAdjs CURSOR LOCAL FOR .... But if I use INSENSITIVE like this: DECLARE crBadAdjs INSENSI...

Bolding or Hilighting node in a CTreeCtrl
I am looking for a way of of bolding, hilighting, or changing the text color for one specific node in a CTreeCtrl. Is this possible? If so, how? You have use an owner draw tree control. Look in here for one: http://www.codeproject.com/treectrl/#Custom+Tree+Controls This one looks useful http://www.codeproject.com/treectrl/colortreectrl.asp AliR. <mr.porteiro.head@gmail.com> wrote in message news:1141668031.681508.117640@u72g2000cwu.googlegroups.com... > I am looking for a way of of bolding, hilighting, or changing the text > color for one specific node in a CTreeCtrl. Is t...

CTreeCtrl EditLabel
Ok here is the problem. I have created an owner drawn tree (CCheckTree). Each node in the tree has a check box beside it. I have derived (CEditableCheckTree) from (CCheckTree). CEditableCheckTree has the edit labels style. When I call the EditLabel function the edit control shows up but when I left click in the edit control the caret isn't placed in the control, I can't select the text, or type into the control. I can right click and paste into the control, but that is just about all. Also if I call the edit control's SetFocus function it never receives focus. I know that I'm o...

General Question
I'm just curious... on an everyday Excel usability level, Im considere a genious here at work. Then I read this site and realize I know nex to nothing compared to the people on here. Where'd you all learn th in depth knowledge about excel? I think VB might be a good step for m to take next, since I know hardly anything about it, and Im reading o here how useful it could be... -- Message posted from http://www.ExcelForum.com Johnny personally, I started using Excel, became interested, went on a VBA course, started on a VBA Project, came to the group for advice and guidance, finis...

CDialog/Invalidate/UpdateWindow question
I have a dialog based application with the main dialog calling DoModal on another dialog. The second dialog is involved in some synchronous stored procedure calls, and things that take time to complete. I can't change the processing to threads at this point, but have learned my lesson. My question is, when the user clicks on a second application in the task bar, which is then maximized, or brought to the front in the z-order on the desktop...when the dialog based app taskbar button is pressed, nothing happens until it's completed. Is there something I can do in OnPaint to bring it ...

Calculation Question
Date Dates Days on Group Shifts Total Number of days missed Sick Gone By SickList Working Passed Group1 Group2 Group3 Group4 1/3/2003 1/3/2003 1.00 1 1 1 0 0 0 1/4/2003 2.00 2 1 1 1 0 0 1/5/2003 3.00 3 1 1 1 1 0 1/6/2003 4.00 4 1 1 1 1 1 1/7/2003 5.00 1 2 2 1 1 1 1/8/2003 6.00 2 2 2 2 1 1 1/9/2003 7.00 3 2 2 2 2 1 1/10/2003 8.00 4 2 2 2 2 2 1/11/2003 9.00 1 3 3 2 2 2 1/12/2003 10.00 2 3 3 3 2 2 1/13/2003 11.00 3 3 3 3 3 2 1/14/2003 12.00 4 3 3 3 3 3 1/15/2003 13.00 1 4 4 3 3 3 1/16/2003 14.00 2 4 4 4 3 3 1/17/2003 15.00 3 4 4 4 4 3 1/18/2003 16.00 4 4 4 4 4 4 1/19/20...

send/receive question
How do you set the send/receive so that you can see the progress bar after clicking on it? I have the progress bar in the hiden mode, but would like to see it. Hi Shawn > How do you set the send/receive so that you can see the > progress bar after clicking on it? I have the progress > bar in the hiden mode, but would like to see it. Tools->SendReceive Settings->Show progress Uncheck "Don't show this dialog during send/receive" WBR Henry ...

Newbie Question
Hello all, I am quite new to Microsoft CRM, actually very new! :) My first (of I am sure many) question is, is it a requirement for my server to be a domain controller to install Microsoft CRM? When I run the install, I receive an error indicating that I must be a member of the Domain Admins group to install the product. Yes, I am logged in as the admin. Can someone shed some light for me? -- Bob Mixon http://attunesystems.mywsssite.com Do You Collaborate? Hi Bob, MS CRM must be installed in a server which must be a member of a domain (Active Directory). Unless you're install...

Assertion on FreeLibrary
Hello all, Not having to much luck with trying to write a regular plug in dll, latest problem is when I return from using the dll and do FreeLibrary: //in the calling unit: void CDynLoadTestDllsDlg::OnDoitButton() { LPCTSTR sTemp; typedef void (CALLBACK* LPFNCHNG)(CString,CString); typedef LPCTSTR (CALLBACK* LPFNLKUP)(CString); LPFNCHNG lpfnChng; LPFNLKUP lpfnLkUp; HINSTANCE hPI; hPI=LoadLibrary("D:\\CustPIs\\DLL_2.dll"); CString s1 = "sSrceServer"; CString s2 = "123.4.5.678"; if(lpfnChng = (LPFNCHNG)GetProcAddres...

OL 2003; Question about two default attachments in HTMLMessage Format
This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C51E85.7F26CCA0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0010_01C51E85.7F26CCA0" ------=_NextPart_001_0010_01C51E85.7F26CCA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Outlook 2003, XPP SP2=20 Hello, When I send an e-mail message in HTML message format, the recipient = (even when I send to myself) also receives two default attachments, = image001.png and image002.png. The first image is a what I would guess a = Microsoft ...

CTreeCtrl
I have a CTreeCtrl with a couple of leafs and each leaf has a checkbox associated with it. If the user checks the checkbox of a leaf, how do I determine which leaf was checked? What callback can be used to get the check state of a leaf? NMCLICK msg works but I do not know how to get the current leaf that was clicked on. Does anybody know? Scott O' http://www.it-faq.pl/mskb/261/289.HTM Regards, Victor "ScottyO" <ofriels@abc.com> wrote in message news:ulAhetDREHA.3140@TK2MSFTNGP11.phx.gbl... > I have a CTreeCtrl with a couple of leafs and each leaf has a checkbo...

Custom color question + smooth chart curves question
I have prepared a large number of Excel templates that have charts I pre-defined for the user. Each of the user-defined charts I set up uses colors that are non-standard (I added them into the color palette using RGB values). These custom colors conform to a corporate palette. These Excel templates were set up so that users could develop charts that they would paste into a Word template that had also been set up to conform to many of the same colors. Within Excel, I actually added the custom swatches to the palette, along the bottom row, which has room for such user-defined colors. The inten...

Blackberry Question
Our ISP provides our mail. We use a catch all mail box at the ISP and my exchange server goes out every 15 min. and pull down the mail from the catch-all id. Exchange then splits up the mail on the local machine to each user. How will blackberry work when my client is on the road? Does it have VPN capabilities to come through my firewall and sync from the exchange server? Or do I have to set up a separate mailbox for him at the ISP? Dan Dan wrote: > Our ISP provides our mail. We use a catch all mail > box at the ISP and my exchange server goes out every 15 min. and pull > down ...

CTreeCtrl ::EnsureVisible
hi all, I've been using a tree ctrl in a modeless dialog to display some data. When I call ensurevisible(treeitemhandle) from outside the dialog it works really well except if the handle is for a child item... If the handle is for a child item then the scroll only goes to the root node leaving the child hidden below the node. this behavior still happens with the node expanded or collapsed before the call. No difference if I use SelectSetFirstVisible(treeitemhandle) still only scrolls to the node. Any ideas what might be happening or someway to make it work right? Thanks, Johnny "...

CSVDE Question
Hello All: I need to import over 300 contacts into our GAL. I need all info to be imported such as name, address, phone # , company name etc, but cannot figure out how to format the .csv file so that all of this information is captured correctly. Do you know of anywhere that I can find a template (csv) to use to format a file for import to GAL with CSVDE? Or, a resource where I can find formatting for th edifferent fields. Can't find anything other than name and email address. Thanks in advance Have you checked this KBA? http://support.microsoft.com/kb/327620 If this doesn...

assertion problem in Mixed mode DLL
Pardon the cross post, but I'm not sure where exactly to post this question. We have MFC application using many MFC extention DLL's. We started using a new MFC extention DLL that is mixed mode so we could use some .Net components we have built. We are getting an assertion in ~CCmdTarget when exiting our app when after making a call to Windows Forms MessageBox. On line 48, m_dwRef is 2 for some reason. Offending line - System::Windows::Forms::MessageBox::Show("Test"); Is there some function I need to call to release something that I am missing? Any ideas? Thanks... Craig...

Chart formatting question
I am working on a bubble chart that has 10 points of data that I am plotting. The y-axis scale set up is maximum=14, major unit= 2, minor unit=.4 and the x-axis scale set up is maximum=12, major unit= 1, minor unit=.2. The data the chart represents has the highest value up the y-axis= 10 and the lowest value on the x-axis=4.5. My question is, the chart looks very horizontal. I would love to increase the y-axis somehow so the bubbles look higher. Is there a way to increase the y-axis scale somehow so that the chart looks more square-like? If I am missing something really elementary here,...

page up/down in subform question
I have a main form with several subforms. In a couple of my subforms, when I press pgdwn it goes to a new record. I know that if you press page down twice it will do that, but on these subforms it does it on the first press. My other forms work fine. Any thoughts on why this may be happening? Ways I can get it to act like the others (pgdwn=pgdwn)? Noe -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200712/1 Generally you need more than the records in the view to have Page Down work more than once to get to a new record. If your records to...