Posts: 3
Registered: ‎07-11-2011
Message 1 of 2 (616 Views)

IAdComparator does not work with dwfx's converted by Design Review

616 Views, 1 Replies
07-19-2011 12:55 PM

I get the following error when using the Compare function if either DWFX file has been converted from a DWG by Design Review: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."


I use the following code:


IAdMarkupEditor3 markupEditor = (IAdMarkupEditor3)axCExpressViewerControl1.MarkupEditor;
IAdComparator Comparator = (IAdComparator)markupEditor.Comparator;
Comparator.Compare(@"C:\temp\File1.dwfx", "Model", @"C:\temp\File2.dwfx", "Model");

 If the files were manually exported from autocad, the above code works fine.  But if I do a SaveAs via the axCExpressViewerControl to convert a DWG to a DWFX (or manually open the drawing in Design Review and to a SaveAs), the above code does not work. However, if I manually compare the two files with Design Review, it does work.


Does anyone know what's going on?  Am I doing something wrong? Or is there a workaround?





Posts: 3
Registered: ‎02-06-2013
Message 2 of 2 (484 Views)

Re: IAdComparator does not work with dwfx's converted by Design Review

02-06-2013 03:48 AM in reply to: kingj02

I know it's been a while, but for anyone who's had the same, I worked out you need to have the correct section names in the Compare method call instead of "Model" (unless your section names are exactly that).


Sample files I've got have names like this: "com.autodesk.dwf.ePlot_3E09234F-F951-46EA-ABC1-FD82346DA123".


I found if the section names don't match you get the rather unhelpful and worrying protected memory exception.


I found the section names in the manifest.xml files within the DWF, but I guess there are other ways to obtain them. I'm looking to read these programatically.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.