I have a forward declaration in my header file - class CLogItemData and have the following also :
this is declared outside my classCode:typedef CArray<CLogItemData*,CLogItemData*> logDetails;
this is declared as a private member of my class.Code:logDetails* m_logDetails;
Now in my implementation file I have the following :
and in OnIntDialog I have the following :Code:void CDialogReportPrintLog::LogDetails(logDetails& aryItemDataArray) { m_logDetails = &aryItemDataArray; }
when I do the following and examine the contents of logCode:CString strIDSFormat; int nSize = m_logDetails->GetSize(); // Determine what time of fields are available to the user to filter for (int nLoop = 0; nLoop < nSize; nLoop++) { CLogItemData* log = (CLogItemData*)m_logDetails->GetAt(nLoop); if ((!m_bDateTime) && (log->m_lDateTime != 0)) { strIDSFormat.FormatMessage(IDS_STRINGDATETIME); m_bDateTime = !m_bDateTime; } m_comboSortFirstOrder.AddString(strIDSFormat); }
its fine - I see all the data I need. However, if I do the following as well:Code:CLogItemData* log = (CLogItemData*)m_logDetails->GetAt(nLoop);
I get a really annoying error - error C2027: use of undefined type 'CLogItemData'Code:if ((!m_bDateTime) && (log->m_lDateTime != 0)) { .... }
... see declaration of 'CLogItemData'
C:\dev\ivs2\source\DialogReportPrintLog.cpp(58) : error C2065: 'm_lDateTime' : undeclared identifier
1. How can it say that CLogItemData is undefined when I can GetAt() an element and also look at the contents of log?
2. and how can 'm_lDateTime' be undeclared when I can visiblely see it in the log object (which is defined as CLogItemData).
it does not like me doing log->m_lDateTime!!!
Can anyone see waht it is I'm missing here?
regards
John


Reply With Quote
