mfc中如何使用自己的类
mfc中怎么使用自己的类
我在vs2008中创建了个基于对话框的类
然后我自己创建了一个C++类
class CPlayer
{
public:
void fileopen()
{}
};
然后我在dlg 类里面
.h 里面添加了#include"player.h"
CPlayer p ;
然后在对应的cpp文件里
p.fileopen();
然后报错。。。
error LNK2019: 无法解析的外部符号 "public: void __thiscall CPlayer::OpenFile(void)" (?OpenFile@CPlayer@@QAEXXZ),该符号在函数 "public: void __thiscall CdsPlayerDlg::OnFileOpen(void)" (?OnFileOpen@CdsPlayerDlg@@QAEXXZ) 中被引用
怎么回事
怎么解决
------解决方案--------------------
我在vs2008中创建了个基于对话框的类
然后我自己创建了一个C++类
class CPlayer
{
public:
void fileopen()
{}
};
然后我在dlg 类里面
.h 里面添加了#include"player.h"
CPlayer p ;
然后在对应的cpp文件里
p.fileopen();
然后报错。。。
error LNK2019: 无法解析的外部符号 "public: void __thiscall CPlayer::OpenFile(void)" (?OpenFile@CPlayer@@QAEXXZ),该符号在函数 "public: void __thiscall CdsPlayerDlg::OnFileOpen(void)" (?OnFileOpen@CdsPlayerDlg@@QAEXXZ) 中被引用
怎么回事
怎么解决
------解决方案--------------------