我定义了三个类:
1.class RegCtrl(普通C++类)
2.class FileImporter(主工程,ATL/COM接口类)
3.class CombineProperty(普通C++类)
我在FileImporter类里面包含引用RegCtrl类没有问题.在FileImporter.h里面加入
#include "RegCtrl.h"
class FileImporter
{
...
private:
RegCtrl m_regCtrl;
}现在我将FileImporter类里面对RegCtrl的引用去掉,将RegCtrl类的引用放到CombineProperty类里面,出现下列问题:
#include "RegCtrl.h"
class CombineProperty
{
...
private:
RegCtrl m_regCtrl;
}
编译时:
Compiling...
stdafx.cpp
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(9) : error C2653: 'std' : is not a class or namespace name
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(9) : error C2143: syntax error : missing ';' before '<'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(9) : error C2238: unexpected token(s) preceding ';'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(10) : error C2653: 'std' : is not a class or namespace name
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(10) : error C2059: syntax error : '<'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(10) : error C2039: 'iterator' : is not a member of 'operator``global namespace'''
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(10) : error C2238: unexpected token(s) preceding ';'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(12) : error C2653: 'std' : is not a class or namespace name
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(12) : error C2059: syntax error : '<'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(12) : error C2238: unexpected token(s) preceding ';'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(13) : error C2653: 'std' : is not a class or namespace name
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(13) : error C2059: syntax error : '<'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(13) : error C2039: 'iterator' : is not a member of 'operator``global namespace'''
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(13) : error C2238: unexpected token(s) preceding ';'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(14) : error C2146: syntax error : missing ';' before identifier 'm_mapDefaultPropertyKey'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(14) : error C2501: 'RegCtrl::DefaultPropertyKey' : missing storage-class or type specifiers
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(14) : error C2501: 'RegCtrl::m_mapDefaultPropertyKey' : missing storage-class or type specifiersBuild log was saved at "file://h:\Vaio\VzFwImport\VzFwImport\VzFwImport\Debug\BuildLog.htm"
VzFwImport - 17 error(s), 0 warning(s)我的RegCtrl类定义如下:
class RegCtrl
{
public:
RegCtrl(void);
~RegCtrl(void);
private:
typedef std::map<LONG,BSTR> DefaultProperty;
typedef std::map<LONG,BSTR>::iterator DefaultPropertyItr; typedef std::map< LONG,DefaultProperty> DefaultPropertyKey;
typedef std::map< LONG,DefaultProperty >::iterator DefaultPropertyKeyItr;
DefaultPropertyKey m_mapDefaultPropertyKey; BSTR m_bstrThumbnailPath;
public:
HRESULT GetDefaultProperty(LONG* lpPropCount,LONG* lpPropId,BSTR * pbstrPropValueList);
};有哪位大侠给俺讲讲?谢谢了.
1.class RegCtrl(普通C++类)
2.class FileImporter(主工程,ATL/COM接口类)
3.class CombineProperty(普通C++类)
我在FileImporter类里面包含引用RegCtrl类没有问题.在FileImporter.h里面加入
#include "RegCtrl.h"
class FileImporter
{
...
private:
RegCtrl m_regCtrl;
}现在我将FileImporter类里面对RegCtrl的引用去掉,将RegCtrl类的引用放到CombineProperty类里面,出现下列问题:
#include "RegCtrl.h"
class CombineProperty
{
...
private:
RegCtrl m_regCtrl;
}
编译时:
Compiling...
stdafx.cpp
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(9) : error C2653: 'std' : is not a class or namespace name
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(9) : error C2143: syntax error : missing ';' before '<'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(9) : error C2238: unexpected token(s) preceding ';'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(10) : error C2653: 'std' : is not a class or namespace name
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(10) : error C2059: syntax error : '<'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(10) : error C2039: 'iterator' : is not a member of 'operator``global namespace'''
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(10) : error C2238: unexpected token(s) preceding ';'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(12) : error C2653: 'std' : is not a class or namespace name
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(12) : error C2059: syntax error : '<'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(12) : error C2238: unexpected token(s) preceding ';'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(13) : error C2653: 'std' : is not a class or namespace name
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(13) : error C2059: syntax error : '<'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(13) : error C2039: 'iterator' : is not a member of 'operator``global namespace'''
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(13) : error C2238: unexpected token(s) preceding ';'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(14) : error C2146: syntax error : missing ';' before identifier 'm_mapDefaultPropertyKey'
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(14) : error C2501: 'RegCtrl::DefaultPropertyKey' : missing storage-class or type specifiers
h:\VAIO\VzFwImport\VzFwImport\VzFwImport\RegCtrl.h(14) : error C2501: 'RegCtrl::m_mapDefaultPropertyKey' : missing storage-class or type specifiersBuild log was saved at "file://h:\Vaio\VzFwImport\VzFwImport\VzFwImport\Debug\BuildLog.htm"
VzFwImport - 17 error(s), 0 warning(s)我的RegCtrl类定义如下:
class RegCtrl
{
public:
RegCtrl(void);
~RegCtrl(void);
private:
typedef std::map<LONG,BSTR> DefaultProperty;
typedef std::map<LONG,BSTR>::iterator DefaultPropertyItr; typedef std::map< LONG,DefaultProperty> DefaultPropertyKey;
typedef std::map< LONG,DefaultProperty >::iterator DefaultPropertyKeyItr;
DefaultPropertyKey m_mapDefaultPropertyKey; BSTR m_bstrThumbnailPath;
public:
HRESULT GetDefaultProperty(LONG* lpPropCount,LONG* lpPropId,BSTR * pbstrPropValueList);
};有哪位大侠给俺讲讲?谢谢了.
解决方案 »
- 对象关闭时,不允许操作!
- 关于矩形框与图像显示问题
- 怎样让填入的数字在按回车以后才生效
- 急!。。。。。。。发送网络封包。高手请指教
- 新手求助,利用ODBC进行SQL数据库的查询
- 我需要一个可编辑的datagrid控件,怎么办呢?
- 如何做到“选中Check Box时,使它后面的字 字体改变颜色?”
- mschart即时更新问题
- 谁可以自己实现 fprintf(FILE *, const char *, ...);
- 今年35岁了,做vc++6年了,还没有确定方向,该往哪里走?
- 大家来给做个参谋!帮帮忙!!!意见多多意善。多多意善。
- 请教:寻找ftp download、ftp upload 和 http的源代码
如果你在stdafx.h定义了,那么CombineProperty.h或者RegCtrl.h中include了它了吗?