|
void testSave ()
{
// get the Active Document interface and check to see
// if the current dwg has been saved
LPDISPATCH pAcadDisp = acedGetAcadWinApp()->GetIDispatch(TRUE);
if(pAcadDisp == NULL)
return false;
IAcadApplicationPtr IAcadApp(pAcadDisp);
IAcadDocumentPtr IAcadDoc;
if (FAILED(IAcadApp->get_ActiveDocument(&IAcadDoc)))
return false;
VARIANT_BOOL saved(VARIANT_FALSE);
if (FAILED(IAcadDoc->get_Saved(&saved)))
return false;
if (saved == VARIANT_FALSE)
IAcadDoc->Save();
return true;
} |
|