I have an old application and it's using CArchive to serialize the object to binary file.
Since I have the source code, I know the object structure in C++ format.
However, is it possible to deserialize CArchive object in C# ?
When I try to read using C# FileStream, it fails with error message :
"The input stream is not a valid binary format."
Thanks in advance...
It would be possible if you knew the exact format of the serialized data. But I guess, you don't. There is no .NET type that is able to serialize/deserialize CArchive-compatible streams.
On the other hand, you can write a mixed-mode DLL that provides that functionality, acting as a managed wrapper over a CArchive.
And another solution is to write a COM server that provides a COM object that wraps the CArchive.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)