Click here to Skip to main content
15,902,842 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Update only a particial area of a View with UpdateAllViews(...) Pin
David Crow11-Jul-08 7:29
David Crow11-Jul-08 7:29 
AnswerRe: Update only a particial area of a View with UpdateAllViews(...) Pin
CrocodileBuck11-Jul-08 23:12
CrocodileBuck11-Jul-08 23:12 
QuestionRe: Update only a particial area of a View with UpdateAllViews(...) Pin
David Crow12-Jul-08 7:19
David Crow12-Jul-08 7:19 
GeneralRe: Update only a particial area of a View with UpdateAllViews(...) Pin
CrocodileBuck11-Jul-08 6:19
CrocodileBuck11-Jul-08 6:19 
QuestionHow to find ActiveX Control corresponding file in VC9? Pin
followait11-Jul-08 3:56
followait11-Jul-08 3:56 
QuestionCArray problem Pin
Trupti Mehta11-Jul-08 3:37
Trupti Mehta11-Jul-08 3:37 
AnswerRe: CArray problem Pin
Mark Salsbery11-Jul-08 4:59
Mark Salsbery11-Jul-08 4:59 
GeneralRe: CArray problem Pin
Trupti Mehta12-Jul-08 0:57
Trupti Mehta12-Jul-08 0:57 
Hi Mark,

If I add objects in array like you are adding, then my code is working perfect. But I am working different way. In my GUI, I add objects in the array in my GUI CPage4 (m_page4 member var), then on Ok button I create DeptStock deptStock object & SetCStockEntryArr(m_page4.GetStockEntries()).
TILL this things are fine.
Then I pass deptStock to a file to store the object details in file.
g_dbOperations.Write_StockTextFile(deptStock);

// WRITE Departments MAP TO FILE
void DbOperations::Write_StockTextFile(DeptStock deptStock) {
	
        .........  
	CString toWrite;
	int index = -1;

	OperatorDetails od = deptStock.GetOperator();
	DeptDetails dd = deptStock.GetDept();
	CArray<cstockentry,>& stockArr = deptStock.GetStockEntryArr();  // This returns 0 sizxe array
//	stockArr = deptStock.GetStockEntryArr();

/*	CStockEntry cse1(2.2f, 5, 10.2f);
	CStockEntry cse2(5.0f, 3, 15.0f);
	stockArr.Add(cse1);
	stockArr.Add(cse2);
*/	
	CString str(_T("Stock Size:"));
	str.Format(_T("%s %d \n %s %d"), str, stockArr.GetSize(), _T("Dept Stock Arr "), deptStock.GetStockEntryArr().GetSize());   
	AfxMessageBox(str);   // Both DISPLAYS 0


This is how the flow is. If I remove the above comments of adding objects od CStockEntry to stockArr, it gives proper results. But I have already added the array elements & not able to retrive.

I have given a better & clear picture of the flow of my program & error point. Hope you can help me out to track the problem.

Thanks

Terry

GeneralRe: CArray problem Pin
Mark Salsbery12-Jul-08 7:47
Mark Salsbery12-Jul-08 7:47 
QuestionHow can I display a cursor for the text? Pin
danginkgo11-Jul-08 3:35
danginkgo11-Jul-08 3:35 
AnswerRe: How can I display a cursor for the text? Pin
led mike11-Jul-08 5:22
led mike11-Jul-08 5:22 
QuestionRegarding Application.ScreenUpdating() - Draw Graph in Excel Pin
vimaltiwari11-Jul-08 3:35
vimaltiwari11-Jul-08 3:35 
AnswerRe: Regarding Application.ScreenUpdating() - Draw Graph in Excel Pin
led mike11-Jul-08 5:25
led mike11-Jul-08 5:25 
QuestionEnterCriticalSection() problem on Vista Pin
SRKSHOME11-Jul-08 3:31
SRKSHOME11-Jul-08 3:31 
AnswerRe: EnterCriticalSection() problem on Vista Pin
Mark Salsbery11-Jul-08 5:27
Mark Salsbery11-Jul-08 5:27 
GeneralRe: EnterCriticalSection() problem on Vista Pin
SRKSHOME14-Jul-08 4:58
SRKSHOME14-Jul-08 4:58 
GeneralRe: EnterCriticalSection() problem on Vista Pin
Mark Salsbery14-Jul-08 5:43
Mark Salsbery14-Jul-08 5:43 
GeneralRe: EnterCriticalSection() problem on Vista Pin
SRKSHOME14-Jul-08 19:09
SRKSHOME14-Jul-08 19:09 
GeneralRe: EnterCriticalSection() problem on Vista Pin
Mark Salsbery15-Jul-08 5:36
Mark Salsbery15-Jul-08 5:36 
GeneralRe: EnterCriticalSection() problem on Vista Pin
SRKSHOME17-Jul-08 3:12
SRKSHOME17-Jul-08 3:12 
GeneralRe: EnterCriticalSection() problem on Vista Pin
Mark Salsbery17-Jul-08 5:37
Mark Salsbery17-Jul-08 5:37 
GeneralRe: EnterCriticalSection() problem on Vista Pin
SRKSHOME12-Aug-08 1:05
SRKSHOME12-Aug-08 1:05 
AnswerRe: EnterCriticalSection() problem on Vista Pin
Joe Woodbury11-Jul-08 10:26
professionalJoe Woodbury11-Jul-08 10:26 
GeneralRe: EnterCriticalSection() problem on Vista Pin
SRKSHOME11-Jul-08 23:35
SRKSHOME11-Jul-08 23:35 
GeneralRe: EnterCriticalSection() problem on Vista Pin
Joe Woodbury12-Jul-08 7:07
professionalJoe Woodbury12-Jul-08 7:07 

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.