OLE Structured Storage files

  • Thread starter Thread starter David Groves
  • Start date Start date
D

David Groves

Are there any plans to incorporate a native C# facility to deal with the OLE
Structured Storage concept? It's clumsy at best to have to construct a C++
interface to the .doc files (or any such files by any suffix), when
Microsoft uses the concept in most, if not all, of their other products.
"Just how hard could it be?" he asks, knowing that 'hard' is a relative
concept.
 
Hi David,

I would also like to see such a facility in the next version of the
framework, even if I realize Microsoft probably plans to move away from the
OLE technology in the future and replace it with XML/binary serialization.

So far, have you tried searching the Web for a ready-made wrapper? I believe
there should be something like that, and it might be even free - there are
many interesting open-source .NET projects out there.
 
"Just how hard could it be?" he asks, knowing that 'hard' is a relative

Not hard at all. On my third day having having installed a beta of Visual
Studio.NET I had something that pretty much worked. Basic COM interop. I
only implemented the read bits of the interfaces (no update), since that was
all I needed but it was only a matter of patience.
Since then I lost the code and everything, but hope is not lost. A while ago
I found this: http://www.mvps.org/emorcillo/ Follow the links for
Source Code>.NET
and you'll find source code to handle structured storage in the .NET world.
The source code is in VB.NET but the assembly works in any language, of
course, and if you really want C# you can always hand-translate it (it
shouldn't take more than a couple of hours). Good luck!
 
Thank you both for your input. I see that I didn't make myself clear: I do
have a solution, and it is 'basic COM interop'-based, but my quest was for a
'pure' C# solution. Even if Microsoft is planning a move away from the OLE
Structured Storage methodology, there's a huge legacy presence of the
current usage, and it doesn't seem likely that everyone will drop the format
immediately upon hearing that there's an XML alternative. I am developing a
solution that uses both the OSS structure and XML, so that we can move at a
comfortable pace toward XML and away from OSS, but I'm still frustrated that
I have to depend on the hand-waving that the COM approach seems to require.

Again, thanks to both of you, Dimitriy and WildHeart, for your very helpful
replies.
 
I am developing a
solution that uses both the OSS structure and XML, so that we can move at a
comfortable pace toward XML and away from OSS, but I'm still frustrated that
I have to depend on the hand-waving that the COM approach seems to
require.

I understand exactly what you mean and share your disappointment. One of the
good things about structured storage is that, just like in filesystems, you
can do incremental upgrades to on of the leaves of the document without
upsetting the rest. Something which you cannot do with plain XML unless you
use a dedicated XML database (Yukon seems to be heading in that direction
and there are others). But it's not quite the same thing.
At some point one guy wrote an open-source replacement for structured
storage in C#. It's somewhere on Sourceforge though nobody seems to have
touched it for years. As I said, it was a replacement and not a
plug-compatible library, so you weren't able to read or write WinWord
documents using the library but you could only create new documents with a
philosophy similar to structured storage. I am afraid that's all there is. I
wonder if there are any commercial implementations out there but given the
decreased interest in the format I doubt it.
 
Back
Top