IAPCProject::SaveCompleted problem

O

Olivier.Parent

Hello VBA programmers

I am debugging an application that has a strange problem. It is an MFC
application that is implementing VBA (Using VBA SDK 6.0 V6.3).

There is an Autobackup feature that sometimes fail and a MessageBox
with "Path/File access error" message is displayed. After that error is
displayed it seems that the ApcProject is corrupted

Here is the code that causes the problem

// Save the contents
BOOL fSaveProject = !!ApcProject;
if (fSaveProject)
{
HRESULT hr = ApcProject.Save(pStorage, FALSE);
fNeedSaveCompleted = !ApcGetEmbedded(this);
if (FAILED(hr))
{
g_pDebugLog->Write("===> SaveToStorageAuto...
ApcProject.Save Failed! hr: %d", hr);
AfxThrowOleException(hr);
}
}

// Serialize uses the m_lpRootStorage
m_lpRootStg = pStorage;
Serialize(saveArchive);
m_lpRootStg = pOrigStg;

if (fSaveProject)
{
fNeedSaveCompleted = FALSE;

HRESULT hr = ApcProject.SaveCompleted(NULL);
g_pDebugLog->Write("SaveToStorageAuto save completed hr:
%d", hr);
ASSERT(SUCCEEDED(hr));
}

The problem is on the SaveCompleted line.
It only happens when the autobackup is running and the user is typing
code in VBA IDE.
The pStorage pointer points to the backup storage (not the original
storage)
I have tried to use the IApcProject::SaveCopyAs method but it always
returns APC_E_NOPERMISSION and i don't know why. There is not much help
about this.

PLEASE HELP!!

Regards

Oli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top