我想将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的使用语法,所以看起来微软在某个地方定义了这个函数,但是链接器退出了,并返回了错误LNK2019。请参阅附件中的图片。

构建如下所示的输出:
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的解释,我知道他们的意思。我想要解决这个特定的错误实例:那么我遗漏了哪些引用?
发布于 2015-09-07 17:57:40
这为我解决了这个问题:
DDX_Text(pDX, IDC_PRODUCTIONDATE, COleDateTime(m_ProductionDate));https://stackoverflow.com/questions/32435159
复制相似问题