Array Declaration problem

All questions regarding Windows programming, post here. API,COM, ActiveX, DirectX, OpenGL, MFC and so on...

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Array Declaration problem

Postby rag84dec » Wed Jul 11, 2007 5:26 pm

Code: Select all
do{
        HTREEITEM htree=NULL;
//        a_Count=0;
//        CString t[]=new CString[];
//CString t[a_Count]= CTreeCtrl::GetItemText(a_TreeItem);
htree=CTreeCtrl::GetNextItem(a_TreeItem,TVI_ROOT);
//a_Count++;
     }while(htree!=NULL);


CAn anyone tell me what is the problem here??
I am getting errors like htree undeclared and if i remove the comments i get various errors....

Please help
rag84dec
 
Posts: 34
Joined: Thu Jun 14, 2007 4:34 pm

Postby MXP » Thu Jul 12, 2007 2:09 pm

To use htree in the test clause of the do-while loop it needs to be declared outside of the loop. The test clause is outside of the scope of the loop.

The rest of the lines give you errors because they are syntax errors. I have responded to the correct way to create an array in your other thread.

On a side note, please dont take this the wrong way, but I more than highly recommend stopping Windows development to take some time to become much more familiar with the C++ language.
Need information on a function I've posted? Chances are it's at the MSDN.
MXP
 
Posts: 6506
Joined: Mon Sep 22, 2003 5:27 pm


Return to Windows Programming

Who is online

Users browsing this forum: No registered users and 1 guest