msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with IApcProject::SaveCompleted

 
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE
Author Message
Oli



Joined: 04 Oct 2007
Posts: 2

PostPosted: Wed Feb 22, 2006 12:49 pm    Post subject: Problem with IApcProject::SaveCompleted Reply with quote

Hello Ole 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 file 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;

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

Additionnal informations :
- The problem is on the SaveCompleted line. Even if the problem occurs the
hr is S_OK.
- 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). This Storage is created earlier with a call to
::StgCreateDocfile(T2COLE(strAutoBackup),
STGM_READWRITE|STGM_DIRECT|STGM_SHARE_EXCLUSIVE|STGM_CREATE,
0,
&lpStorage);

- I have tried to use the IApcProject::SaveCopyAs method to make a backup
copy but it always returns APC_E_NOPERMISSION and i don't know why.

There is not much help about these topic.

PLEASE HELP!!

Regards

Oli

Archived from group: microsoft>public>vb>ole
Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Word save as MHT problem Howdy, I am trying to save files from Word as MHTML. I don't have a problem saving files unless they have JavaScript in them. When they contain JavaScript, any images are not saved. Is there a way to get Word to save those files from software? -- Frank

Ole Simple Problem(x2)? (VB/Word) I have an Ole Object in a vb6 form (class = I load the form calling the following: (this loads the word file into the ole object for display) Ole.SourceDoc = "here goes the file source" Ole.Action = Then, I have a button c

Strange problem with VB and macros Hi. I am using Word 2000 with VB on Windows 2000. We have created a macro (in WORD) which is called from VB through the "Run" method. The macro works fine. The problem is that when i run the VB code, from visual basic IDE, everything works fine as expecte

Help: Problem on oleaut32.dll for VB debugger? I write a program for simple server and client. Both of them use a VB6.0(Sp5) to develop run in Win2000 Server and Win2000 platform. No use third party for the applications. I use VB to build an ActiveX control for communication between

Urgent Automation error problem Hello All, This is a very very critical problem for me. I have automated word through visual basic. My application creates a word document at run-time. I have Windows XP on the system where I am developing this application. When I run this applicaiton on
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group