I have a blob file which I take from a database. This blob is actually an MXD file. I want to load this MXD to an
axLayoutControl (ArcGIS Engine). But for security reasons I do not want to write this on disk and then load it with
LoadMXD(string path) method. I want to pass it to my layout control directly. So I need to convert it to some interface like
IMXDContents. Below is the code I use. But the exception "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))" is thrown on
ObjectStream.LoadObject(ref guid, k) . I googled this and the only thing I found was that I should change my platform target to x86 instead of Any CPU. Believe me I tried this in every posible way. And still not working. Can anyone please help?
IXMLStream pXMLStream = new XMLStreamClass(); pXMLStream.LoadFromBytes(ref bytes); //bytes is the cast of blob file to bytes array IObjectStream ObjectStream = new ObjectStreamClass(); ObjectStream.Stream = pXMLStream as IStream; IMxdContents k = new PageLayoutClass(); Guid guid = typeof(IMxdContents).GUID; ObjectStream.LoadObject(ref guid, k);