一个关于《VC6.0技术内幕(第五版)》的问题

sqzth 2002-09-15 03:59:39
我在看第六章的时候
根据说上说的步骤 自己做了一个程序
编译通过 没有任何错误
可是就是 按下“右键”的时候没有反应
本来应该出现的对话框没有出现
...全文
109 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
sqzth 2002-09-15
  • 打赏
  • 举报
回复
我说的是 这本书的
ex06a 这个程序
有没有看书的时候也遇到同样的问题呀
rivershan 2002-09-15
  • 打赏
  • 举报
回复
void CEx06aView::OnLButtonDown(UINT nFlags, CPoint point)
//明明是左键吗~是你贴错了还是说错了~
{
// TODO: Add your message handler code here and/or call default
CEx06aDialog dlg;
dlg.m_strName ="2222";
dlg.m_nSsn =307806636;
dlg.m_nCat =1;
dlg.m_strBio ="This person is not a well-motivated tech writer";
dlg.m_bInsLift=TRUE;
dlg.m_bInsDis =FALSE;
dlg.m_bInsMed =TRUE;
dlg.m_strDept ="Documentation";
dlg.m_strSkill="Writer";
dlg.m_nLang =0;
dlg.m_strEduc ="College";
dlg.m_nLoyal =dlg.m_nRely=50;
int ret=dlg.DoModal();
TRACE("DoModal return = %d\n", ret);
TRACE("name = %s, ssn = %d, cat = %d\n",
dlg.m_strName, dlg.m_nSsn, dlg.m_nCat);
TRACE("dept = %s, skill = %s, lang = %d, educ = %s\n",
dlg.m_strDept, dlg.m_strSkill, dlg.m_nLang, dlg.m_strEduc);
TRACE("life = %d, dis = %d, med = %d, bio = %s\n",
dlg.m_bInsLift, dlg.m_bInsDis, dlg.m_bInsMed, dlg.m_strBio);
TRACE("loyalty = %d, reliability = %d\n",
dlg.m_nLoyal, dlg.m_nRely);
}
andy_lau 2002-09-15
  • 打赏
  • 举报
回复
我看的是第4版,你把程序的功能说一下,实在不行,发到我信箱里,我给你看看
cyj302@hotmail.com
969209pxb 2002-09-15
  • 打赏
  • 举报
回复
OnLButtonDown(),左键码?
sqzth 2002-09-15
  • 打赏
  • 举报
回复
// ex06aView.h : interface of the CEx06aView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_EX06AVIEW_H__82C26989_662C_454C_9B98_85FE3949D16D__INCLUDED_)
#define AFX_EX06AVIEW_H__82C26989_662C_454C_9B98_85FE3949D16D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CEx06aView : public CView
{
protected: // create from serialization only
CEx06aView();
DECLARE_DYNCREATE(CEx06aView)

// Attributes
public:
CEx06aDoc* GetDocument();

// Operations
public:

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEx06aView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
//}}AFX_VIRTUAL

// Implementation
public:
virtual ~CEx06aView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
//{{AFX_MSG(CEx06aView)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG // debug version in ex06aView.cpp
inline CEx06aDoc* CEx06aView::GetDocument()
{ return (CEx06aDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////
这是头文件
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_EX06AVIEW_H__82C26989_662C_454C_9B98_85FE3949D16D__INCLUDED_)

实现文件
// ex06aView.cpp : implementation of the CEx06aView class
//

#include "stdafx.h"
#include "ex06a.h"

#include "ex06aDoc.h"
#include "ex06aView.h"
#include "ex06aDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CEx06aView

IMPLEMENT_DYNCREATE(CEx06aView, CView)

BEGIN_MESSAGE_MAP(CEx06aView, CView)
//{{AFX_MSG_MAP(CEx06aView)
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEx06aView construction/destruction

CEx06aView::CEx06aView()
{
// TODO: add construction code here

}

CEx06aView::~CEx06aView()
{
}

BOOL CEx06aView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs

return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CEx06aView drawing

void CEx06aView::OnDraw(CDC* pDC)
{
pDC->TextOut(0,0,"Press the left mouse button down here.");
// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CEx06aView diagnostics

#ifdef _DEBUG
void CEx06aView::AssertValid() const
{
CView::AssertValid();
}

void CEx06aView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}

CEx06aDoc* CEx06aView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx06aDoc)));
return (CEx06aDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CEx06aView message handlers

void CEx06aView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CEx06aDialog dlg;
dlg.m_strName ="张太恒";
dlg.m_nSsn =307806636;
dlg.m_nCat =1;
dlg.m_strBio ="This person is not a well-motivated tech writer";
dlg.m_bInsLift=TRUE;
dlg.m_bInsDis =FALSE;
dlg.m_bInsMed =TRUE;
dlg.m_strDept ="Documentation";
dlg.m_strSkill="Writer";
dlg.m_nLang =0;
dlg.m_strEduc ="College";
dlg.m_nLoyal =dlg.m_nRely=50;
int ret=dlg.DoModal();
TRACE("DoModal return = %d\n", ret);
TRACE("name = %s, ssn = %d, cat = %d\n",
dlg.m_strName, dlg.m_nSsn, dlg.m_nCat);
TRACE("dept = %s, skill = %s, lang = %d, educ = %s\n",
dlg.m_strDept, dlg.m_strSkill, dlg.m_nLang, dlg.m_strEduc);
TRACE("life = %d, dis = %d, med = %d, bio = %s\n",
dlg.m_bInsLift, dlg.m_bInsDis, dlg.m_bInsMed, dlg.m_strBio);
TRACE("loyalty = %d, reliability = %d\n",
dlg.m_nLoyal, dlg.m_nRely);
}

damm 2002-09-15
  • 打赏
  • 举报
回复
OnLButtonDown,是左键咧
hzjdg 2002-09-15
  • 打赏
  • 举报
回复
这个代码好像没有问题啊,能不能把对话框类贴出来啊。
sqzth 2002-09-15
  • 打赏
  • 举报
回复
这个是 右键的处理代码
void CEx06aView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CEx06aDialog dlg;
dlg.m_strName ="2222";
dlg.m_nSsn =307806636;
dlg.m_nCat =1;
dlg.m_strBio ="This person is not a well-motivated tech writer";
dlg.m_bInsLift=TRUE;
dlg.m_bInsDis =FALSE;
dlg.m_bInsMed =TRUE;
dlg.m_strDept ="Documentation";
dlg.m_strSkill="Writer";
dlg.m_nLang =0;
dlg.m_strEduc ="College";
dlg.m_nLoyal =dlg.m_nRely=50;
int ret=dlg.DoModal();
TRACE("DoModal return = %d\n", ret);
TRACE("name = %s, ssn = %d, cat = %d\n",
dlg.m_strName, dlg.m_nSsn, dlg.m_nCat);
TRACE("dept = %s, skill = %s, lang = %d, educ = %s\n",
dlg.m_strDept, dlg.m_strSkill, dlg.m_nLang, dlg.m_strEduc);
TRACE("life = %d, dis = %d, med = %d, bio = %s\n",
dlg.m_bInsLift, dlg.m_bInsDis, dlg.m_bInsMed, dlg.m_strBio);
TRACE("loyalty = %d, reliability = %d\n",
dlg.m_nLoyal, dlg.m_nRely);
}
quinton 2002-09-15
  • 打赏
  • 举报
回复
SubItem(0)->.......
kingofvc 2002-09-15
  • 打赏
  • 举报
回复
右键的处理代码?

16,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧