Questions tagged [carchive]

32 questions
0
votes
1 answer

Conditional reading of CArchive operator overload in structure data

I have two serialize operator overloads: friend CArchive& operator<<(CArchive& rArchive, S_MEMORIAL_INFO const& rsMI) { return rArchive << rsMI.strHost << rsMI.strCohost << rsMI.strZoomAttendant << rsMI.strChairman …
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
0 answers

Is it possible to add `<<` and `>>` operators to a structure itself for serialization to CArchive?

I have this structure: using BETHEL_SPEAKER_SERVICE_TALK_INFO_S = struct tagBethelSpeakerServiceTalkInfo { CString strHost; CString strCohost; CString strChairman; CString strOpenPrayer; CString strSpeaker; CString strTheme; …
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
1 answer

Retrieve information from CArchive File

Is there any way to retrieve information from a CArchive file if we don't know what type of objects are stored in the CArchive file? I want to know in what format information is stored in a CArchive file. Please help me out in this.
0
votes
2 answers

How can I get the size of the file referenced in a CArchive?

I have just started to get back into c++ after years using Perl, php and assembler and I am trying to create a simple MFC program using Visual Studio 2017 and c++ to open binary files for viewing. I am trying to work within the code created by the…
Bill H
  • 9
  • 3
0
votes
1 answer

Using CArchive::GetObjectSchema returns wrong value

I have a problem here. In my main application header file I have these definitions: #define SOUNDROTA_VERSION_171801 171801 // 17.1.8 Beta 1 #define SOUNDROTA_VERSION_CURRENT 171801 // 17.1.8 Beta 1 In my application I have a CObject derived…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
0 answers

How to write cv::Mat to CArchive? (in the MFC function Serialize(CArchive& ar))

I'm trying to write matImage cv::Mat matImage; matImage.create(480, 640, CV_8U); to a bmp-file (for example "test.bmp") through Serialize(CArchive& ar) in the MFC application. This code doesn't work void CApplDoc::Serialize(CArchive& ar) { if…
Vic.S
  • 23
  • 6
0
votes
1 answer

Read data stored with CArchive Ar(&SaveDataStoreDetail, CArchive::store);

i have dat file which stored value using Ar<
0
votes
1 answer

Execution order of c++

I created a program that tests carchive. I wanted to see how fast it took to save a million data points: #include "stdafx.h" #include "TestData.h" #include #include using namespace std; void pause() { cin.clear(); cout…
Batman
  • 541
  • 4
  • 25
0
votes
1 answer

CArchive (MFC) to JSON?

I have to receive data from server. Server's application is written in VS2008 (MFC). There is only one way to send this data from server -> as CArchive object. I can't change server source. I want to receive this data in PHP (by tcp), and convert…
Ahemski
  • 93
  • 8
0
votes
1 answer

Easiest way to convert CArchive to use SQL database for serialization?

I have an existing application that uses CArchive to serialize a object structure to a file. I am wondering if can replace the usage of CArchive with some custom class to write to a database the same way that things are serialized. Before I go…
Klathzazt
  • 2,415
  • 19
  • 27
0
votes
2 answers

CArchive serialization with operators << >> no operator found which takes a left-hand of type cArchive

Following this tutorial, http://msdn.microsoft.com/en-us/library/vstudio/3bfsbt0t.aspx I implement this code: class Esame: public CObject { public: INT voto; INT crediti; BOOL lode; CString nome; Esame(){} Esame(CString nome, INT voto, BOOL lode,…
volperossa
  • 1,339
  • 20
  • 33
0
votes
1 answer

Save & Load scroll bar state in a dialog based MFC application using serialization.

I am working on a dialog based MFC application that consists of check boxes, scroll bars, buttons, edit control etc. I am trying to save the application's current state into a .txt file and then load it back when the application starts again. I use…
Sharath
  • 2,225
  • 3
  • 24
  • 37
0
votes
1 answer

Read array of struct from binary data save by CArchive

I am trying to read data from a file which is being written by CArchive. I have the original source which is being used to read and write using CArchive. But, I am trying to read this through C# code. I am able to read much of the file, but I got…
fhnaseer
  • 7,159
  • 16
  • 60
  • 112
0
votes
0 answers

COleStreamFile::OpenStream replacement in C#

I have a code written in MFC for file reading and writing. I am rewriting it for C#. My file consists of three parts, Header *Body* and Footer. Now in MFC code CArchive can write/read any of these parts. This is done by COleStreamFile::OpenStream.…
fhnaseer
  • 7,159
  • 16
  • 60
  • 112
0
votes
1 answer

Save application settings MFC CArchive way

I have several settings in app witch I want to be saved on changing it. there is check box: void CL2HamsterDlg::OnBnClickedCheckAutoselect() { CFile theFile( pFileName1,CFile::modeWrite ); CArchive ar(&theFile, CArchive::store); …
Klasik
  • 872
  • 1
  • 9
  • 29