二次开发第一要义:查帮助
CAA打开文档函数的帮助如下:
OpenDocument
public static HRESULT OpenDocument( const CATUnicodeString& iStorageName,
CATDocument*& oOpenedDoc,CATBoolean iReadOnly =FALSE)
功能:打开一个给定的文档。
Role: If the file already exists in the session, it will not be re-loaded.
The document must be removed from the session before exiting or when it is no longer needed. See explanations at the top of this page about the life cycle of the document.
Note: This method does not allow opening .feat or .CATfct catalogs. It is not possible to access .feat catalogs because they contain Dassault Systemes private data. To open a .CATfct catalog, see CATCatalogFactoryServices (ObjectSpecsModeler framework).
Parameters:
iStorageName
The complete access name of the file to open ( path + name of the file ).
See CATDocument.StorageName for more information about the storage name.
oOpenedDoc
The opened document.
If the "open" is a "re-open", the pointer is not a new pointer. Do not remove the pointer twice.
iReadOnly
FALSE: Default value, the document will be in read/write mode.
TRUE: The document is in read only mode.
In case of a re-opening, the mode of the document is defined by the first open.
Returns:
S_OK : The document was opened sucessfully.
S_FALSE : The document has already been loaded. The returned oOpenedDoc pointer points to this document.
E_FAIL : The open operation failed.
怎么用呢,上代码:
CATSession *pSession = NULL;
HRESULT rc=NULL;
rc = ::Create_Session("CAA_PrdProp_Session", pSession);
// Opening an existing document with full path specified
CATDocument *pDoc =NULL;
CATUnicodeString strPath="C:Usersweiwu-chenDesktop卷线器改juanxianqi.CATProduct";//juanxianqi.CATProduct";
rc = CATDocumentServices::OpenDocument(strPath, pDoc);
if (FAILED(rc)|| NULL==pDoc)
{
return;
}
本文来自爱汐投稿,不代表胡巴网立场,如若转载,请注明出处:https://www.hu85.com/124043.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 xxxxx@qq.com 举报,一经查实,本站将立刻删除。