error LNK2001: unresolved external symbol "public: class CAnalyserDoc * __thiscall CMySkyView::GetDocument(void)" (?GetDocument@CMySkyView@@QAEPAVCAnalyserDoc@@XZ)
我自己建了一个类
class CMySkyView : public CView在CMySkyView里面需要与其他对话框等通讯,所以使用了 CMySkyView::GetDocument 这样有什么错误?
我自己建了一个类
class CMySkyView : public CView在CMySkyView里面需要与其他对话框等通讯,所以使用了 CMySkyView::GetDocument 这样有什么错误?
解决方案 »
- 求修改Button,Edit,Combox等控件背景色及字体颜色的类库。。。
- 双缓冲技术的实现,在图像处理程序中,在dib上进行了一些标记操作,闪烁的厉害,如何用双缓冲克服,
- 关于串口空间MSCOMM问题?
- Sockket从FTP服务器上下载文件
- 为什么存储一条记录后,要过两三秒钟之后才能读取出来?
- 如何由Debug版的lib生成Release版的lib?高手请进!
- 请教一个关于文件搜索的小问题?谢谢您的帮助!
- WM_PAINT消息
- 那里有<<vc++ 6.0 mfc扩展编程实例>>中的例子的代码下栽?
- 哪里有<深入浅出MFC>的下载呀?
- 这个问题应该怎么样去解决了?
- 如何读取一个二进制文件,根据内部数据绘制曲线
是不是不小心写到#ifdef _DEBUG
#endif //_DEBUG里面去了
{
...
};#ifndef _DEBUG // debug version in BView.cpp
inline CXXXDoc* CBView::GetDocument()
{ return (CBDoc*)m_pDocument; }
#endif
// MySkyView.h : header file
//
#include "SimuSet.h"
#include <list>
#include <vector>
using namespace std;
#include "AnalyserDoc.h"class Model;
/////////////////////////////////////////////////////////////////////////////
// CMySkyView view
#define UM_PROGRESS WM_USER+1class CMySkyView : public CView
{
protected:
CMySkyView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMySkyView)// Attributes
public:
// CFCAnalyserDoc* GetDocument();
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMySkyView)
//}}AFX_VIRTUAL// Implementation
protected:
virtual ~CMySkyView();#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
inline CFCAnalyserDoc* CMySkyView::GetDocument()
{ return (CFCAnalyserDoc*)m_pDocument; }
#endif // Generated message map functions
protected:
//{{AFX_MSG(CMySkyView)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
在 cpp里写了
CAnalyserDoc* CMySkyView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAnalyserDoc)));
return (CAnalyserDoc*)m_pDocument;
}
是不是你头文件包含的问题?增加了#include "AnalyserDoc.h"不?
上面的是我主要的框架
另外我还自定义了一些函数
在那些函数里用了 CAnalyserDoc * pDoc = GetDocument();
我在 MySkyView.h 里包含了 "AnalyserDoc.h" 的啊
为了和其他的对话框视图啥的通讯 我在在CMySkyView的一些自定义函数里用了 CAnalyserDoc * pDoc = GetDocument() 这样对不?
我新建的这个 CMySkyView 类 本来是 没有 这个“CAnalyserDoc* GetDocument();”的 这个里面是这样的
#ifndef _DEBUG // debug version in BView.cpp
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
inline CFCAnalyserDoc* CMySkyView::GetDocument()
{ return (CFCAnalyserDoc*)m_pDocument; }
#endif在 cpp里写了
CAnalyserDoc* CMySkyView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAnalyserDoc)));
return (CAnalyserDoc*)m_pDocument;
}这样写的话DEBUG版本也编译不过吧,改成这样
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endifinline CFCAnalyserDoc* CMySkyView::GetDocument()
{ return (CFCAnalyserDoc*)m_pDocument; }
#ifndef _DEBUG // debug version in SDIDemoView.cpp
inline CSDIDemoDoc* CSDIDemoView::GetDocument()
{ return (CSDIDemoDoc*)m_pDocument; }
#endif
virtual void Dump(CDumpContext& dc) const;去掉?
把
inline CFCAnalyserDoc* CMySkyView::GetDocument()
{ return (CFCAnalyserDoc*)m_pDocument; }
写在
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
外面也不行啊