void CAVICapVideoView::OnDraw()
{
CAVICapVideoDoc * pDoc = GetDocument();
ASSERT_VALID(pDoc); RECT rect;
GetClientRect(&rect);
DrawDibDraw(m_hdd,
pDC->GetSafeHdc(),
rect.left,
rect.top,
rect.right,
rect.bottom,
((LPBITMAPINFOHEADER)(CMainFrame*)AfxGetMainWnd()->m_dibinfo.Buffer),
NULL,
0,
0,
-1,
-1,
0);
}
报错
C:\Program Files\Microsoft Visual Studio\MyProjects\AVICapVideo\AVICapVideoView.cpp(112) : error C2511: 'OnDraw' : overloaded member function 'void (void)' not found in 'CAVICapVideoView'
c:\program files\microsoft visual studio\myprojects\avicapvideo\avicapvideoview.h(18) : see declaration of 'CAVICapVideoView''CAVICapVideoView'定义在AVICapVideoView.h如下:
class CAVICapVideoView : public CView
{protected: // create from serialization only
HDRAWDIB m_hdd;
CAVICapVideoView();
DECLARE_DYNCREATE(CAVICapVideoView)
// Attributespublic:
CAVICapVideoDoc* GetDocument();// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAVICapVideoView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL// Implementation
public:
virtual ~CAVICapVideoView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endifprotected:// Generated message map functions
protected:
//{{AFX_MSG(CAVICapVideoView)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
麻烦大家了。。
{
CAVICapVideoDoc * pDoc = GetDocument();
ASSERT_VALID(pDoc); RECT rect;
GetClientRect(&rect);
DrawDibDraw(m_hdd,
pDC->GetSafeHdc(),
rect.left,
rect.top,
rect.right,
rect.bottom,
((LPBITMAPINFOHEADER)(CMainFrame*)AfxGetMainWnd()->m_dibinfo.Buffer),
NULL,
0,
0,
-1,
-1,
0);
}
报错
C:\Program Files\Microsoft Visual Studio\MyProjects\AVICapVideo\AVICapVideoView.cpp(112) : error C2511: 'OnDraw' : overloaded member function 'void (void)' not found in 'CAVICapVideoView'
c:\program files\microsoft visual studio\myprojects\avicapvideo\avicapvideoview.h(18) : see declaration of 'CAVICapVideoView''CAVICapVideoView'定义在AVICapVideoView.h如下:
class CAVICapVideoView : public CView
{protected: // create from serialization only
HDRAWDIB m_hdd;
CAVICapVideoView();
DECLARE_DYNCREATE(CAVICapVideoView)
// Attributespublic:
CAVICapVideoDoc* GetDocument();// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAVICapVideoView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL// Implementation
public:
virtual ~CAVICapVideoView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endifprotected:// Generated message map functions
protected:
//{{AFX_MSG(CAVICapVideoView)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
麻烦大家了。。
解决方案 »
- VC++串口通讯问题
- 给个波形数据库构造的建议---好建议有分
- 如何得到当前的操作系统的登陆用户名?
- 关于windows文件浏览器里的右键菜单项
- Visual C++ 技术内幕 那个版本比较好?随便up,给分的……!
- 3721是怎么取得IE的输入框的字符的?100分酬谢
- 怎么得到MDI子窗体的窗体句柄或指针?
- 关于OpenGL开发电厂可视化GIS的问题
- 拖放问题,高手请进(第二次提同样的问题)
- 目前想学习COM,请问大家COM入门级的书是什么书最好?COM不用面向对象语言如C能编吗?
- 我的MDI程序在启动的时候通过OnFileNew()创建了三个文档。我是想在文档对应的视图中绘图,比如在文档1对应的视图中画圆,在文档2对应的视图中画矩形.但是我不知道在OnDraw()函数中如何添加代码来实现。因为我在OnDraw()函数中添加了画圆的程
- 在MDI的CView::OnDraw(CDC* pDC)函数中,如何通过pDC在不同的子窗体中画出不同的图形?其中文档、视图和子窗体是一一对应的关系。
改为:
void CAVICapVideoView::OnDraw(CDC* pDC)
void CShipSurveyView::OnDraw(CDC* pDC)
{
CShipSurveyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
CECView::OnDraw(pDC);
// TODO: add draw code for native data here
DrawAll(pDC);
}
带CDC参数
void CAVICapVideoView::OnDraw(CDC* pDC)
{
CAVICapVideoDoc * pDoc = GetDocument();
ASSERT_VALID(pDoc); RECT rect;
GetClientRect(&rect);
DrawDibDraw(m_hdd,
pDC->GetSafeHdc(),
rect.left,
rect.top,
rect.right,
rect.bottom,
((LPBITMAPINFOHEADER)(CMainFrame*)AfxGetMainWnd()->m_dibinfo.Buffer), NULL,
0,
0,
-1,
-1,
0);
}
报错如下C:\Program Files\Microsoft Visual Studio\MyProjects\AVICapVideo\AVICapVideoView.cpp(124) : error C2039: 'm_dibinfo' : is not a member of 'CWnd'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(1899) : see declaration of 'CWnd'
C:\Program Files\Microsoft Visual Studio\MyProjects\AVICapVideo\AVICapVideoView.cpp(124) : error C2228: left of '.Buffer' must have class/struct/union type不会又是括号的问题吧。
(LPBITMAPINFOHEADER)((CMainFrame*)AfxGetMainWnd())->m_dibinfo.Buffer
晕,不是说过了么,强制转换的优先级没有->的优先级高。
{
CAVICapVideoDoc * pDoc = GetDocument();
ASSERT_VALID(pDoc);
RECT rect;
GetClientRect(&rect);
DrawDibDraw(m_hdd,
pDC->GetSafeHdc(),
rect.left,
rect.top,
rect.right,
rect.bottom,
(LPBITMAPINFOHEADER)((CMainFrame*)AfxGetMainWnd())->m_dibinfo.buffer,
NULL,
0,
0,
-1,
-1,
0);}报错如下:
AVICapVideoView.obj : error LNK2001: unresolved external symbol _DrawDibOpen@0
AVICapVideoView.obj : error LNK2001: unresolved external symbol _DrawDibClose@4
AVICapVideoView.obj : error LNK2001: unresolved external symbol _DrawDibDraw@52
MainFrm.obj : error LNK2001: unresolved external symbol "protected: __thiscall CMainFrame::CMainFrame(void)" (??0CMainFrame@@IAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol _capCreateCaptureWindowA@32
Debug/AVICapVideo.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.
{
CAVICapVideoDoc * pDoc = GetDocument();
ASSERT_VALID(pDoc);
RECT rect;
GetClientRect(&rect);
DrawDibDraw(m_hdd,
pDC->GetSafeHdc(),
rect.left,
rect.top,
rect.right,
rect.bottom,
(LPBITMAPINFOHEADER)((CMainFrame*)AfxGetMainWnd())->m_dibinfo.Buffer,
NULL,
0,
0,
-1,
-1,
0);}
报错如下:
C:\Program Files\Microsoft Visual Studio\MyProjects\AVICapVideo\AVICapVideoView.cpp(125) : error C2039: 'Buffer' : is not a member of 'DIBINFO'
c:\program files\microsoft visual studio\myprojects\avicapvideo\mainfrm.h(15) : see declaration of 'DIBINFO'
void CAVICapVideoView::OnDraw(CDC* pDC)
{
#pragma comment(lib, "Vfw32.lib")
CAVICapVideoDoc * pDoc = GetDocument();
ASSERT_VALID(pDoc);
RECT rect;
GetClientRect(&rect);
DrawDibDraw(m_hdd,
pDC->GetSafeHdc(),
rect.left,
rect.top,
rect.right,
rect.bottom,
(LPBITMAPINFOHEADER)((CMainFrame*)AfxGetMainWnd())->m_dibinfo.buffer,
NULL,
0,
0,
-1,
-1,
0);}
报错如下:
MainFrm.obj : error LNK2001: unresolved external symbol "protected: __thiscall CMainFrame::CMainFrame(void)" (??0CMainFrame@@IAE@XZ)
Debug/AVICapVideo.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
{
}