Laurent W
August 6th, 2004, 08:55 AM
I have a problem to deserialize a file in a mixed C++ managed and MFC project.
1st step:
I have an existing SDI MFC application that can serialize my own serializable objects. These objects are in an MFC dll. In these case all works fine.
2nd step:
The serialized files has to be used with a dotnet application (c# or Managed C++). To do that, I added to my previous MFC dll project the support of the managed C++ (/clr). I added a __gc class that wrapps my own serializable objets.
To sum up, this dll is both an assembly .net and an MFC dll. With my MFC application I use the MCF parts of the dll by including the header file and the library file. With the dotnet application, I use the dotNet part by #using the dll.
There is no compilation error in the both project.
3rd step:
At the runtime of the MFC application there is no error, I can serialize and deserialize my files. Note, in these cases the CArchive object is managed by the CDocument object of the MFC SDI application.
4th step:
At the runtime of the dotnet application, the files are not deserialized. Note, in these case the CArchive is created by my dll in loading mode only and is not linked to a document.
Is somebody can help me to solve my problems or give some track to follow ?
Note: the serialized file contains some List of my own serializable objects.
1st step:
I have an existing SDI MFC application that can serialize my own serializable objects. These objects are in an MFC dll. In these case all works fine.
2nd step:
The serialized files has to be used with a dotnet application (c# or Managed C++). To do that, I added to my previous MFC dll project the support of the managed C++ (/clr). I added a __gc class that wrapps my own serializable objets.
To sum up, this dll is both an assembly .net and an MFC dll. With my MFC application I use the MCF parts of the dll by including the header file and the library file. With the dotnet application, I use the dotNet part by #using the dll.
There is no compilation error in the both project.
3rd step:
At the runtime of the MFC application there is no error, I can serialize and deserialize my files. Note, in these cases the CArchive object is managed by the CDocument object of the MFC SDI application.
4th step:
At the runtime of the dotnet application, the files are not deserialized. Note, in these case the CArchive is created by my dll in loading mode only and is not linked to a document.
Is somebody can help me to solve my problems or give some track to follow ?
Note: the serialized file contains some List of my own serializable objects.