function template
Hi
I am trying to use a function template as a member of a class. My class
declaration is as follows:
ref class CListCtrlSetup
{
public:
CListCtrlSetup(void);
template<class T> void InsColumn(T& lst, DataTable^ table);
}
and the function declaration is
template<class T>
void CListCtrlSetup::InsColumn(T& lst, System::Data::DataTable^ table)
{
try
{
DataColumnCollection^ columns = table->Columns;
DataColumn^ column;
CString str;
int i, col = columns->Count;
for(i=0; i<col; i++){
column = columns[i];
str = column->ColumnName;
lst.InsertColumn(i, str);
}
SetColWidth(lst);
}
catch(Exception^ e)
{
MessageBox::Show(e->Message, L".NET Exception Thrown",
MessageBoxButtons::OK,
MessageBoxIcon::Error);
}
}
The class T could be of type CListCtrl or CCheckListCtrl.
But it is giving the following linker error:
error LNK2020: unresolved token (0600000F)
CListCtrlSetup::InsColumn<CListCtrl>
Any idea what is this for?
Thanks in advance.
Manjree