C++ Close command does not purge *lck file

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a trouble with my current Inventor Application coded in C++.
Here what I do :
- Copy an ipt file into a temp folder
- Load the ipt file into Inventor.
- Save it as sat.
- Close the document
- Delete the temp folder
The problem I have is the following, I can't delete the temp folder because there is a lockfile.lck file, even if I wait a few seconds the file is still there and prevent my delete action.
What I notice is :
- if I start Inventor (GUI opens), the problem happens.
- if I do not start Inventor, the problem does not happen.
Here is the code I use :
mModelDoc = application->Documents->Open(
static_cast<LPCTSTR>( filePath ),
VARIANT_FALSE
);
CString newFilePath = folderPath; ::PathAppend( newFilePath.GetBuffer( MAX_PATH ), fileName + _T( ".sat" ) ); newFilePath.ReleaseBuffer();
mModelDoc->SaveAs( static_cast<LPCTSTR>( newFilePath ), VARIANT_TRUE);
mModelDoc->Close( VARIANT_TRUE ); mModelDoc = NULL;
Can someone help me to understand the problem?
Thanks,