- 论坛徽章:
- 0
|
本帖最后由 lishizelibin 于 2010-07-17 15:32 编辑
头文件中
friend FIRSTDLL_EXPORT OdString operator+(const OdString& string1, const OdString& string2);
friend FIRSTDLL_EXPORT OdString operator+(const OdString& string, OdChar ch);
friend FIRSTDLL_EXPORT OdString operator+(OdChar ch, const OdString& string);
friend FIRSTDLL_EXPORT OdString operator+(const OdString& string1, const OdChar* string2);
friend FIRSTDLL_EXPORT OdString operator+(const OdChar* string1, const OdString& string2);
实现文件中
OdString strSheetName = strSeed + DD_T('-') + strLayoutName; //该句出现错误
strSeed 和 strLayoutName 都是OdString类型
#define DD_T(x) __DD_T(x)
#define __DD_T(x) L ## x
error C2666: “operator +”: 4 个重载有相似的转换
4> 可能是“OdString operator +(const OdString &,OdChar)”[通过使用参数相关的查找找到]
4> 或“内置 C++ operator+(OdChar, wchar_t)”
4> 或“内置 C++ operator+(const wchar_t *, wchar_t)”
4> 或“内置 C++ operator+(const char *, wchar_t)”
4> 试图匹配参数列表“(OdString, wchar_t)”时
运行环境:VS2005 |
|