MFC程序如何使用hashtable?

jianmin001 jianmin001 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我工程类型是MFC(exe)类型的.

原文件如下:
// ContainerView.cpp : implementation of the CContainerView class
//

#include "stdafx.h"
#include "Container.h"

#include "ContainerDoc.h"
#include "ContainerView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


using namespace System;
using namespace System::Collections;


/////////////////////////////////////////////////////////////////////////////
// CContainerView

IMPLEMENT_DYNCREATE(CContainerView, CView)

BEGIN_MESSAGE_MAP(CContainerView, CView)
//{{AFX_MSG_MAP(CContainerView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CContainerView construction/destruction

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

}

CContainerView::~CContainerView()
{
}

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

return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CContainerView drawing

void CContainerView::OnDraw(CDC* pDC)
{
CContainerDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CContainerView printing

BOOL CContainerView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}

void CContainerView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}

void CContainerView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CContainerView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CContainerView message handlers

然后报错:


D:\testcode\2007\12.06\Container\ContainerView.cpp(17) : error C2871: 'System' : does not exist or is not a namespace
D:\testcode\2007\12.06\Container\ContainerView.cpp(18) : error C2653: 'System' : is not a class or namespace name
D:\testcode\2007\12.06\Container\ContainerView.cpp(18) : error C2871: 'Collections' : does not exist or is not a namespace

这个应该如何处理呢?谢谢!
...全文
评论 3
收藏 已收藏
分享
返回顶部
jianmin001
VC/MFC 16,550 成员 421,605 内容