本文整理汇总了C++中LPSTORAGE::MoveElementTo方法的典型用法代码示例。如果您正苦于以下问题:C++ LPSTORAGE::MoveElementTo方法的具体用法?C++ LPSTORAGE::MoveElementTo怎么用?C++ LPSTORAGE::MoveElementTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPSTORAGE
的用法示例。
在下文中一共展示了LPSTORAGE::MoveElementTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UtDoStreamOperation
STDAPI UtDoStreamOperation(LPSTORAGE pstgSrc, LPSTORAGE pstgDst, int iOpCode,
DWORD grfAllowedStmTypes)
{
VDATEHEAP();
HRESULT error; // error status so far
IEnumSTATSTG FAR* penumStg; // used to enumerate the storage elements
ULONG celtFetched; // how many storage elements were fetched
STATSTG statstg;
// get an enumerator over the source storage
if (error = pstgSrc->EnumElements(NULL, NULL, NULL, &penumStg))
return error;
// repeat for every storage
while(penumStg->Next(1, &statstg, &celtFetched) == NOERROR)
{
// operate on streams that we're interested in
if (statstg.type == STGTY_STREAM)
{
DWORD stmType;
// find the type of the stream
// REVIEW, we must have constants for these name
// prefixes!!!
switch (statstg.pwcsName[0])
{
case '\1':
stmType = STREAMTYPE_CONTROL;
break;
case '\2':
stmType = STREAMTYPE_CACHE;
break;
case '\3':
stmType = STREAMTYPE_CONTAINER;
break;
default:
stmType = (DWORD)STREAMTYPE_OTHER;
}
// check whether it should be operated upon
if (stmType & grfAllowedStmTypes)
{
switch(iOpCode)
{
#ifdef LATER
case OPCODE_COPY:
pstgDst->DestroyElement(
statstg.pwcsName);
error = pstgSrc->MoveElementTo(
statstg.pwcsName,
pstgDst,
statstg.pwcsName,
STGMOVE_COPY);
break;
case OPCODE_MOVE:
pstgDst->DestroyElement(
statstg.pwcsName);
error = pstgSrc->MoveElementTo(
statstg.pwcsName,
pstgDst,
statstg.pwcsName,
STGMOVE_MOVE);
break;
case OPCODE_EXCLUDEFROMCOPY:
AssertSz(FALSE, "Not yet implemented");
break;
#endif // LATER
case OPCODE_REMOVE:
error = pstgSrc->DestroyElement(
statstg.pwcsName);
break;
default:
AssertSz(FALSE, "Invalid opcode");
break;
}
}
}
// if the enumerator allocated a new name string, get rid of it
if (statstg.pwcsName)
PubMemFree(statstg.pwcsName);
// quit the enumeration loop if we've hit an error
if (error != NOERROR)
break;
}
// release the enumerator
penumStg->Release();
//.........这里部分代码省略.........