提示如下:
error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall CDataGrid::GetRuntimeClass(void)const " (?GetRuntimeClass@CDataGrid@@UBEPAUCRuntimeClass@@XZ)
error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall CDataGrid::GetRuntimeClass(void)const " (?GetRuntimeClass@CDataGrid@@UBEPAUCRuntimeClass@@XZ)
“
RESOLUTION
Do not use static member variables in nested classes of class templates.
”好像不是那样他所值的原因引起的。
(Don't forget to import the CDataGrid class)
then add a variable(For example :cDataGrid) for this control by
using ClassWizard.
Then add codes in the place you want to bind your grid to Recordset
as follows:
....
cDataGrid.SetRefDataSource(NULL);
cDataGrid.SetRefDataSource((LPUNKNOWN)m_pRecordset);
cDataGrid.Refresh();
...