I have a forward declaration in my header file - class CLogItemData and have the following also :

Code:
typedef CArray<CLogItemData*,CLogItemData*> logDetails;
this is declared outside my class

Code:
 logDetails* m_logDetails;
this is declared as a private member of my class.

Now in my implementation file I have the following :

Code:
void CDialogReportPrintLog::LogDetails(logDetails& aryItemDataArray)
{
	m_logDetails = &aryItemDataArray;
}
and in OnIntDialog I have the following :
Code:
	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);
	}
when I do the following and examine the contents of log
Code:
CLogItemData* log = (CLogItemData*)m_logDetails->GetAt(nLoop);
its fine - I see all the data I need. However, if I do the following as well:
Code:
if ((!m_bDateTime) && (log->m_lDateTime != 0))
{
....
}
I get a really annoying error - error C2027: use of undefined type 'CLogItemData'
... 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