You can check if a DWG file is already opened or not, using a file mode for "append." For example, the following code demonstrates the usage:
ACHAR fileName[] = L"myDrawing.dwg";
void fileInUse()
{
ofstream fp(fileName, ios::app) ;
if(!fp) {
acutPrintf(L"%s is IN USE.\n", fileName);
}
else {
acutPrintf(L"%s is NOT in use.\n", fileName);
fp.close();
}
}

Leave a Reply