We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Attempted to read or write protected memory - v4.4.1.0

I get the following error when tring to open the attached document

[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]


Hi

Thanks for your request. I tried to open the attached document using the Aspose.Words v4.4.1.0 and it seems that all works fine on my side.

Make sure that you use the latest version of Aspose.Words. Also, please provide me more information about this error.

Best regards.

I am now using v4.4.2.1, and I get a new error.

[NullReferenceException: Object reference not set to an instance of an object.]
෼.ᡡ.೨(BinaryReader ಲ, TabStops ᡢ, Boolean ᡣ) +379
෼.ᡐ.ᠬ(ᕪ ់, ᠭ ៌, Int32 ៍, BinaryReader ಲ) +1945
෼.ᠳ.೨(Byte[] ᕧ) +576
෼.ᡐ.೨(ᛝ ᛣ, ࣾ ឵, ᡛ ᡓ) +125
෼.᮹.ᯈ(Int32 জ) +928
෼.᮹.೨(BinaryReader ಲ, Int32 ࠚ, Int32 ࣁ) +585
ᐫ.ᐪ.೨() +531
Aspose.Words.Document.ࠈ(Stream ؟, LoadFormat ࠉ, String ׾) +644

[FileCorruptedException: The document appears to be corrupted and cannot be loaded.]
Aspose.Words.Document.ࠈ(Stream ؟, LoadFormat ࠉ, String ׾) +1392
Aspose.Words.Document…ctor(String fileName, LoadFormat loadFormat, String password)

This is using the web version of the control and not the win forms version. I tested opening the document with the windows forms version and it was successful.

Also I resaved the document as both an rtf and a docx and it opened without problem.

Hi

Thanks for additional information. Unfortunately, I can’t reproduce this on my side. I use the following code for testing.

protected void Button1_Click(object sender, EventArgs e)

{

Document doc = new Document(Server.MapPath("tmp41152.27286990.9680684.doc"));

doc.Save("out.doc", SaveFormat.Doc, SaveType.OpenInWord, Response);

}

Could you please provide me code snippet that will allow me to reproduce this problem.

Best regards.

I have a different document which produces both errors.



I am only running one line of code.



Dim TestDoc As New Aspose.Words.Document(“c:\temp\PRQ.doc”)



After experimenting with the document, I found that if removed the following it loaded successfuly



on page 1)

The picture and the table at the bottom.



on page 2)

the line object at the bottom of the table



on page 3)

Both Tables

Hi

Thanks for additional information. Unfortunately, I still can’t reproduce this problem on my side. Please make sure that you use the latest version of Aspose.Words. Also I think that you should use the following code in web application and place your document in web application folder..

Dim TestDoc As New Aspose.Words.Document(Server.MapPath("PRQ.doc"))

Best regards.

I am running Visual Studio 2008 Beta, I have just tested with Visual Studio 2008 RTM and it ran without any problems.