所以我似乎无法正确满足这个构造函数的要求。
DIVA_STATUS DIVA_getObjectDetailsList (
IN BOOL pFirstTime,
IN time_t *initialTime,
IN int pListType,
IN int pObjectsListType,
IN int pMaxListSize,
IN DIVA_STRING pObjectName,
IN DIVA_STRING pObjectCategory
IN DIVA_STRING pMediaName
DIVA_LEVEL_OF_DETAIL pLevelOfDetail,
IN vector<DIVA_STRING> listPosition,
OUT vector<DIVA_OBJECT_DETAILS_LIST> *&pObjectDetailsList
)
问题似乎是输出类向量的最后一行(???)。我对 C++ 有点生疏,所以我不记得为什么要取消引用引用调用 (*&)。
DIVA_OBJECT_DETAILS_LIST 是一个如下所示的类:
class DIVA_OBJECT_DETAILS_LIST {
public:
int listType;
DIVA_STRING siteID;
vector<DIVA_STRING> *listPosition;
vector<DIVA_OBJECT_INFO> *objectInfo;
vector<DIVA_OBJECT_TAPE_INFO> *objectTapeInfo;
};
这是我尝试使用 VC++ 2008 Express 编译时得到的结果
1>Compiling...
1>initiator.cpp
1>.\initiator.cpp(148) : error C2100: illegal indirection
1>.\initiator.cpp(148) : error C2665: 'DIVA_getObjectDetailsList' : none of the 2 overloads could convert all the argument types
1> z:\Mediavault1\Automation\DIVA_API\DIVArchiveAPI\CppAPI Test\include\DIVAapi.h(2191): could be 'DIVA_STATUS DIVA_getObjectDetailsList(bool,time_t,int,int,int,DIVA_STRING,DIVA_STRING,DIVA_STRING,DIVA_LEVEL_OF_DETAIL,std::vector<_Ty>,DIVA_OBJECT_DETAILS_LIST *&)'
1> with
1> [
1> _Ty=DIVA_STRING
1> ]
1> while trying to match the argument list '(bool, time_t, int, int, int, DIVA_STRING, DIVA_STRING, DIVA_STRING, DIVA_LEVEL_OF_DETAIL, std::vector<_Ty>, DIVA_OBJECT_DETAILS_LIST *)'
1> with
1> [
1> _Ty=DIVA_STRING
1> ]
这是我调用构造函数的方式:
cr = DIVA_getObjectDetailsList (
_firstTime,
(time_t)_initDate,
(int)DIVA_OBJECTS_LIST,
(int)DIVA_OBJECTS_CREATED_SINCE,
_size,
_name,
_category,
_group,
DIVA_INSTANCE,
*_listType.listPosition,
&*_listType
);
_listType 是 DIVA_OBJECT_DETAILS_LIST。如何通过引用传递它的指针?