带有DBTIMESTAMP变量的DDX_Text,我需要引用哪个库?

时间:2015-09-07 09:20:53

标签: c++ mfc oledb

我想将DDX_Text与DBTIMESTAMP类型的成员变量一起使用:

class CSerialView : public CFormView
{
    DECLARE_DYNCREATE(CSerialView)
    //.....
public:
    DBTIMESTAMP m_ProductionDate; // read from OLEDB consumer class
    //.....
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    //......
}
void CSerialView::DoDataExchange(CDataExchange* pDX)
{
    CFormView::DoDataExchange(pDX);
    DDX_Text(pDX, IDC_PRODUCTIONDATE, m_ProductionDate);
}

编译很好,DDX_Text的使用语法在Intellisense中列出,因此看起来Microsoft在某个地方定义了这个函数,但链接器出现错误LNK2019。见附图。

enter image description here

构建此处列出的输出:

1>SerialView.obj : error LNK2019: unresolved external symbol "void __stdcall DDX_Text(class CDataExchange *,int,struct tagDBTIMESTAMP &)" (?DDX_Text@@YGXPAVCDataExchange@@HAAUtagDBTIMESTAMP@@@Z) referenced in function "protected: virtual void __thiscall CSerialView::DoDataExchange(class CDataExchange *)" (?DoDataExchange@CSerialView@@MAEXPAVCDataExchange@@@Z)
1>c:\dev\projects\HCPSOrders\Debug\HCPSOrdersApp.exe : fatal error LNK1120: 1 unresolved externals

我不是在寻找LNK2019和LNK1120的解释,我知道它们的含义。我想解决这个特殊的错误实例:所以我错过了哪些引用?

1 个答案:

答案 0 :(得分:-1)

这解决了我的问题:

DDX_Text(pDX, IDC_PRODUCTIONDATE, COleDateTime(m_ProductionDate));