AnsweredAssumed Answered

GetDocument return error "read only file" only file of solidworks2013

Question asked by テ ソ ン キ ム on Jan 13, 2016
Latest reply on Jan 15, 2016 by テ ソ ン キ ム

Hi dear.


I want to add custom property.


my application open solidworks file and next set property and save the file.


first. I use GetDocument method. like this.

CComPtr<ISwDMApplication> swDocMgr;


CComPtr<ISwDMDocument> swDoc;
SwDmDocumentOpenError res1;

swDocMgr->GetDocument((_bstr_t)fileName, docType, bIsReadOnly, &res1, &swDoc);


The third argument mean that TRUE is read only, FALSE is read and write by API Help.

But if i try this source, use solidworks 2013 file. that "swDmDocumentOpenErrorFileReadOnly"

But if i try this solidworks 2015 file. don't return error.


finally. If blsReadOnly be setted TRUE. I can't save file(It is right because i get file read only)


I don't know reason. Please give me inform If you have a idea. Thank you!