Click here to Skip to main content
15,889,116 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dynamically adding Menu in Mainframe menu Pin
David Crow25-Feb-11 2:10
David Crow25-Feb-11 2:10 
AnswerRe: Dynamically adding Menu in Mainframe menu Pin
Hans Dietrich23-Feb-11 22:59
mentorHans Dietrich23-Feb-11 22:59 
QuestionRe: Dynamically adding Menu in Mainframe menu Pin
David Crow24-Feb-11 3:02
David Crow24-Feb-11 3:02 
AnswerRe: Dynamically adding Menu in Mainframe menu Pin
Roger Allen3-Mar-11 1:48
Roger Allen3-Mar-11 1:48 
Questionhow to hide the vertical scrollbar of listbox Pin
raj157623-Feb-11 21:45
raj157623-Feb-11 21:45 
Questionhow to hide the vertical scrollbar of listbox Pin
raj157623-Feb-11 20:38
raj157623-Feb-11 20:38 
AnswerRe: how to hide the vertical scrollbar of listbox Pin
Cool_Dev23-Feb-11 21:27
Cool_Dev23-Feb-11 21:27 
QuestionCPtrList AddTail problem [SOLVED] Pin
Anu_Bala23-Feb-11 17:42
Anu_Bala23-Feb-11 17:42 
Hi im haveing CPtrList and im adding this list by gettign data from xlsheet.What happened after adding details to list,the list having the same last data.suppose the list count is 3,then 3 listitems are same data.Here the code

CPtrList GrPageList;
void CGraphConfig::OnImportgraph()
{
CString TempString,TempInfo,sExt;		
	int PointCount=0,iRow=0;
	CString sFileName = _T("");

	SGrPgConf *pDetl = new SGrPgConf;
	if(pDetl == NULL)
	{
		AfxMessageBox("Memory Allocation Failure ");
		return;
	}
	GrPageList.RemoveAll();	

	CFileDialog oFileOpen(1,"xls",0,0,"MicroSoft Excel Files(*.xls)|*.xls|Tag Detail Grid File(*.tdl)|*.tdl||");//Open Mode
	oFileOpen.m_ofn.lpstrTitle="Import From...";
	if(oFileOpen.DoModal() == IDOK)	
		sFileName=oFileOpen.GetPathName();		
	
	sExt=sFileName.Right(3);
	sExt.MakeLower();

	if(!strcmp(sExt,"xls"))
	{		
		CExcelSheet TagDet(sFileName,"Sheet1",FALSE); 
		
		for(iRow=2;iRow <= TagDet.GetTotalRows();iRow++)
		{
			
			TagDet.ReadCell(TempString,1,iRow);				
			pDetl->iPageNo = atoi(TempString);			
		
			TagDet.ReadCell(TempString,2,iRow);			
			sprintf(pDetl->sPageTitle ,"%s",TempString);

			TagDet.ReadCell(TempString,3,iRow);			
			sprintf(pDetl->sPanelDetail[0] ,"%s",TempString);	

			TagDet.ReadCell(TempString,4,iRow);			
			sprintf(pDetl->sPanelDetail[1] ,"%s",TempString);

                        GrPageList.AddTail(pDetl);	

			
			/////////  Check the List
			POSITION hPos = GrPageList.GetHeadPosition();
			while(hPos)
			{
			SGrPgConf *pData = (SGrPgConf *)GrPageList.GetAt(hPos);  //When I check here			
			GrPageList.GetNext(hPos);
			}					
		}		
		TagDet.Commit();					
	}
}


When i check the list the pData shows the same data(last row - pageno-3.0) three times,GrPageList count is 3.
My XLSheet shows like
PageNo PageTitle FirstKey SecKey
1.0 graph1 Group01 Group02
2.0 graph2 TREND01 TREND02
3.0 graph3 Group01 Group02


Pls help me..
Anu
modified on Thursday, February 24, 2011 1:17 AM

AnswerRe: CPtrList AddTail problem Pin
Cool_Dev23-Feb-11 18:11
Cool_Dev23-Feb-11 18:11 
GeneralRe: CPtrList AddTail problem Pin
Anu_Bala23-Feb-11 19:17
Anu_Bala23-Feb-11 19:17 
Question--i not equal to i - 1 ??? Pin
Cristoff23-Feb-11 11:06
Cristoff23-Feb-11 11:06 
AnswerRe: --i not equal to i - 1 ??? Pin
PJ Arends23-Feb-11 11:31
professionalPJ Arends23-Feb-11 11:31 
GeneralRe: --i not equal to i - 1 ??? Pin
Cristoff23-Feb-11 11:47
Cristoff23-Feb-11 11:47 
AnswerRe: --i not equal to i - 1 ??? Pin
Peter_in_278023-Feb-11 12:23
professionalPeter_in_278023-Feb-11 12:23 
Answeryes the value of --i equals that of i - 1 however the side effects are different Pin
Luc Pattyn23-Feb-11 13:36
sitebuilderLuc Pattyn23-Feb-11 13:36 
GeneralRe: yes the value of --i equals that of i - 1 however the side effects are different Pin
Stefan_Lang24-Feb-11 1:59
Stefan_Lang24-Feb-11 1:59 
QuestionKey pressed time Logic Pin
manchukuo23-Feb-11 9:29
manchukuo23-Feb-11 9:29 
AnswerRe: Key pressed time Logic Pin
David Crow23-Feb-11 9:32
David Crow23-Feb-11 9:32 
GeneralRe: Key pressed time Logic Pin
manchukuo23-Feb-11 10:12
manchukuo23-Feb-11 10:12 
QuestionRe: Key pressed time Logic Pin
David Crow23-Feb-11 10:18
David Crow23-Feb-11 10:18 
AnswerRe: Key pressed time Logic Pin
manchukuo23-Feb-11 10:20
manchukuo23-Feb-11 10:20 
Questionunresolved external symbol error when i compile my win32 app Pin
smishtiaqhussain23-Feb-11 1:53
smishtiaqhussain23-Feb-11 1:53 
AnswerRe: unresolved external symbol error when i compile my win32 app Pin
_AnsHUMAN_ 23-Feb-11 1:56
_AnsHUMAN_ 23-Feb-11 1:56 
AnswerRe: unresolved external symbol error when i compile my win32 app Pin
Richard MacCutchan23-Feb-11 2:02
mveRichard MacCutchan23-Feb-11 2:02 
AnswerRe: unresolved external symbol error when i compile my win32 app Pin
tagopi23-Feb-11 2:03
tagopi23-Feb-11 2:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.