我定义了三个类:
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);
};有哪位大侠给俺讲讲?谢谢了.