求助,出现错误,大神指点一下……不胜感激
天山剑客 2010-12-13 09:19:23 我按着书写桥的代码,出现这个提示,不知道头文件该怎么改?求大神指点一二,不胜感激
请问如何解决error C2511: 'Create' : overloaded member function 'int (class CWnd *)' not found in 'CSplashWnd'
d:\program\vc\txt\txt\splashwnd.h(13) : see declaration of 'CSplashWnd'
// SplashWnd.cpp : implementation file
//
SplashWnd.cpp 为:
#include "stdafx.h"
#include "txt.h"
#include "SplashWnd.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSplashWnd
CSplashWnd::CSplashWnd()
{
}
CSplashWnd::~CSplashWnd()
{
}
BEGIN_MESSAGE_MAP(CSplashWnd, CWnd)
//{{AFX_MSG_MAP(CSplashWnd)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CSplashWnd::Create(CWnd* pParentWnd/*=NULL*/)
{
if(!m_bitmap.LoadBitmap(IDB_SPLASH))
return FALSE;
BITMAP bm;
m_bitmap.GetBitmap(&bm);//得到位图句柄
//创建启动窗口
return CreateEx(0,AfxRegisterWndClass(0,AfxGetApp()->LoadStandardCursor(IDC_ARROW)),NULL,WS_POPUP|WS_VISIBLE,
0,0,bm.bmWidth,bm.bmHeight,pParentWnd->GetSafeHwnd(),NULL);
}
---------------------------------------------------------------------
这个是头文件 SplashWnd.h 为::
#if !defined(AFX_SPLASHWND_H__81B350DC_46B4_4DB7_9AA4_CD6C1B458A1D__INCLUDED_)
#define AFX_SPLASHWND_H__81B350DC_46B4_4DB7_9AA4_CD6C1B458A1D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SplashWnd.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CSplashWnd window
class CSplashWnd : public CWnd
{
// Construction
public:
CSplashWnd();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSplashWnd)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CSplashWnd();
// Generated message map functions
protected:
//{{AFX_MSG(CSplashWnd)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SPLASHWND_H__81B350DC_46B4_4DB7_9AA4_CD6C1B458A1D__INCLUDED_)