监视窗口提示:((*(CWnd*)(&listbox))).m_hWnd CXX0017: 错误: 没有找到符号“listbox”
不知道它为什么要找 listbox
#include "afxwin.h"
#include "afxext.h" // CToolBar 类
class CMainWindow : public CFrameWnd
{
public:
CMainWindow();
afx_msg int OnCreate(LPCREATESTRUCT);
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT,CPoint); virtual BOOL PreCreateWindow(CREATESTRUCT & cs);
CToolBar m_wndToolBar;
public:
DECLARE_MESSAGE_MAP()
};
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
#include"afxwin.h"
#include "resource.h"
#include "CMainWindow.h"CMyApp myApp;
BEGIN_MESSAGE_MAP(CMainWindow,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_CREATE()
// ON_WM_PAINT()
END_MESSAGE_MAP()
BOOL CMyApp::InitInstance ()
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow (SW_SHOW);
m_pMainWnd->UpdateWindow ();
return TRUE;
}
int CMainWindow::OnCreate (LPCREATESTRUCT )
{
/* m_wndToolBar.Create (this);
m_wndToolBar.SetButtonStyle ( 1 , TBBS_CHECKBOX );
m_wndToolBar.LoadBitmapW (IDB_BITMAP1);
UINT A[]={1,2,3,4,5,6,7,8,9,10};
m_wndToolBar.SetButtons (A,10); */// m_wndToolBar.CreateEx(this);
// m_wndToolBar.LoadToolBar(IDR_TOOLBAR1);
// m_wndToolBar.LoadToolBar (IDR_TOOLBAR1);
return 0;
}
CMainWindow::CMainWindow ()
{
Create(0,L"");
}
void CMainWindow::OnLButtonDown (UINT,CPoint)
{
}void CMainWindow::OnPaint ()
{
CFrameWnd::OnPaint ();
}BOOL CMainWindow::PreCreateWindow (CREATESTRUCT & cs)
{
// cs.dwExStyle = ( cs.dwExStyle & ( ~ WS_EX_CLIENTEDGE ) );
return true;
}
不知道它为什么要找 listbox
#include "afxwin.h"
#include "afxext.h" // CToolBar 类
class CMainWindow : public CFrameWnd
{
public:
CMainWindow();
afx_msg int OnCreate(LPCREATESTRUCT);
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT,CPoint); virtual BOOL PreCreateWindow(CREATESTRUCT & cs);
CToolBar m_wndToolBar;
public:
DECLARE_MESSAGE_MAP()
};
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
#include"afxwin.h"
#include "resource.h"
#include "CMainWindow.h"CMyApp myApp;
BEGIN_MESSAGE_MAP(CMainWindow,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_CREATE()
// ON_WM_PAINT()
END_MESSAGE_MAP()
BOOL CMyApp::InitInstance ()
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow (SW_SHOW);
m_pMainWnd->UpdateWindow ();
return TRUE;
}
int CMainWindow::OnCreate (LPCREATESTRUCT )
{
/* m_wndToolBar.Create (this);
m_wndToolBar.SetButtonStyle ( 1 , TBBS_CHECKBOX );
m_wndToolBar.LoadBitmapW (IDB_BITMAP1);
UINT A[]={1,2,3,4,5,6,7,8,9,10};
m_wndToolBar.SetButtons (A,10); */// m_wndToolBar.CreateEx(this);
// m_wndToolBar.LoadToolBar(IDR_TOOLBAR1);
// m_wndToolBar.LoadToolBar (IDR_TOOLBAR1);
return 0;
}
CMainWindow::CMainWindow ()
{
Create(0,L"");
}
void CMainWindow::OnLButtonDown (UINT,CPoint)
{
}void CMainWindow::OnPaint ()
{
CFrameWnd::OnPaint ();
}BOOL CMainWindow::PreCreateWindow (CREATESTRUCT & cs)
{
// cs.dwExStyle = ( cs.dwExStyle & ( ~ WS_EX_CLIENTEDGE ) );
return true;
}
解决方案 »
- var sat:Number = (max == 0)?0:(1-min/max);这句如何翻成DELPHI的。。
- COM報錯Run-Time Check Failure,爲什麽?
- 如何枚举出一个DLL里的函数名字及其入口地址,包括非输出函数?
- 同时打开两个“音量控制”程序,改变其中一个的音量,另一个会跟着变,请问……
- 请问怎么获得系统的时间日期格式并转化为ACCESS数据库的日期时间格式
- 放分,同时请大家帮忙(顶者有分,本周五给分)
- 如何将一个C或C++开辟的内存区指针传给一个参数是句柄的函数
- !焦点问题!—使一控件永远无焦点
- ●●●●怎么在Edit中发送Unicode字符的WM_CHAR消息?●●●●
- 请教,如何在mainframe类里得到view类的指针??
- 关于在vs2008下Windows编程!!求助
- 关于串口的问题
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow (SW_SHOW);
m_pMainWnd->UpdateWindow ();
return TRUE;
}new之后,要create,自己查看MFC里面的源码!
回复3楼。构造函数里面有调用 Create
2、有可能是执行的调试exe是之前的版本 ,检查一下exe的路径
3、有可能是当前调试与之前调试冲突 ----clear rebuild all
谁知道有讲VC2008调试的书。现在的书全都是代码,都没有讲编译器的,作者可能是想让读者把代码打到 word 里去
里前面加
CWinApp::InitInstance();
试试.
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow (SW_SHOW);
m_pMainWnd->UpdateWindow ();
return TRUE;
}CMainWindow对象都没构造完,如何create窗口?
把Create函数拿出来BOOL CMyApp::InitInstance ()
{
m_pMainWnd = new CMainWindow;
/*pMainWnd->Create();*/
m_pMainWnd->ShowWindow (SW_SHOW);
m_pMainWnd->UpdateWindow ();
return TRUE;
}