![]() |
#2
BianChengNan2012-03-09 12:42
|
只有本站会员才能查看附件,请 登录
设置了断点,查到了错误,ASSERT(pThreadState->m_hHookOldCbtFilter != NULL);
ASSERT(pWnd != NULL);
ASSERT(pWnd->m_hWnd == NULL); // only do once
但不知道该如何修改?查了好长时间,也没弄出个头绪,希望你们能帮个忙,非常感谢!

// TestDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "helike.h"
#include "TestDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// CTestDlg 对话框
IMPLEMENT_DYNAMIC(CTestDlg, CDialog)
CTestDlg::CTestDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTestDlg::IDD, pParent)
{
m_bIsCreate=FALSE;
}
CTestDlg::~CTestDlg()
{
}
void CTestDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_BTN_ADD, m_btn);
}
BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
ON_BN_CLICKED(IDC_BTN_ADD, &CTestDlg::OnBnClickedBtnAdd)
END_MESSAGE_MAP()
// CTestDlg 消息处理程序
void CTestDlg::OnBnClickedBtnAdd()
{
// TODO: 在此添加控件通知处理程序代码
static BOOL bIsCreate=FALSE;
if(bIsCreate==FALSE)
{
m_btn.Create(_T("NEW"),BS_DEFPUSHBUTTON | WS_VISIBLE | WS_CHILD,
CRect(0,0,100,100),this,125);
bIsCreate=TRUE;
}
else
{
m_btn.DestroyWindow();
bIsCreate=FALSE;
}
}
//
#include "stdafx.h"
#include "helike.h"
#include "TestDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// CTestDlg 对话框
IMPLEMENT_DYNAMIC(CTestDlg, CDialog)
CTestDlg::CTestDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTestDlg::IDD, pParent)
{
m_bIsCreate=FALSE;
}
CTestDlg::~CTestDlg()
{
}
void CTestDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_BTN_ADD, m_btn);
}
BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
ON_BN_CLICKED(IDC_BTN_ADD, &CTestDlg::OnBnClickedBtnAdd)
END_MESSAGE_MAP()
// CTestDlg 消息处理程序
void CTestDlg::OnBnClickedBtnAdd()
{
// TODO: 在此添加控件通知处理程序代码
static BOOL bIsCreate=FALSE;
if(bIsCreate==FALSE)
{
m_btn.Create(_T("NEW"),BS_DEFPUSHBUTTON | WS_VISIBLE | WS_CHILD,
CRect(0,0,100,100),this,125);
bIsCreate=TRUE;
}
else
{
m_btn.DestroyWindow();
bIsCreate=FALSE;
}
}
[ 本帖最后由 时光吉祥 于 2012-3-8 22:05 编辑 ]