HRESULT hr;
CATDocument *pDocument = NULL;
CATFrmEditor* pEdit = CATFrmEditor::GetCurrentEditor();
CATILinkableObject* pILinkableOnActive = NULL;
hr = pEdit->GetUIActiveObject().Search(
IID_CATILinkableObject,
(void**)&pILinkableOnActive);
pDocument = pILinkableOnActive->GetDocument();//获取到文档
if(pEdit == NULL)
{
return (CATStatusChangeRCAborted);
}
if (pDocument == NULL)
{
return (CATStatusChangeRCAborted);
}
CATIDocRoots* piDocRoot = NULL;
hr = pDocument->QueryInterface(IID_CATIDocRoots,(void**)&piDocRoot);
if (FAILED(hr) || piDocRoot == NULL)
{
return (CATStatusChangeRCAborted);
}
CATListValCATBaseUnknown_var* spRootList = NULL;
if (SUCCEEDED(spRootList = piDocRoot->GiveDocRoots()) && (spRootList != NULL))
{
piDocRoot->Release();
piDocRoot = NULL;
}
CATIProduct_var spiRootProduct = NULL_var;
if (spRootList->Size())
{
spiRootProduct = (*spRootList)[1];
delete spRootList;
spRootList = NULL;
}
CAA隐藏显示状态的获取与设置代码实现

最低0.47元/天 解锁文章
2677

被折叠的 条评论
为什么被折叠?



