MODI.Document.Create() throws Access Violation exception on being called 2nd time

A

agilegeek

Hi,

I have one function as,
This is in Office 2007, Microsoft Office Document Imaging.

GetModiDoc()
{
ModiDocument12* pMDoc = NULL;
pMDoc = new ModiDocument12();
pMDoc->CreateDispatch("MODI.Document", &e)
pMDoc->Create((LPCTSTR)m_csTiffCName);
pMDoc->Close(bSaveChangesOnClose);
delete pMDoc;
pMDoc = NULL;
}

I am calling this function from main() as;

main()
{
do{
if (get request for procee)
GetModiDoc();
}while();
}


The first time call to GetModiDoc() works super. But the next time, on
calling GetModiDoc() I get the following exception,
Unhandled exception at 0x3260ba70 in docstore.exe: 0xC0000005: Access
violation reading location 0x0217129c.


Kindly someone help. I read that Close() is unable to close files
properly and release handles ? Is it so ?

Thanks,
Agyle
 

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