0

i have dat file which stored value using

Ar<<sDmdDataStore.iMachineNo;
Ar<<sDmdDataStore.csOptName;
Ar<<sDmdDataStore.csLocationofStone;

how to read data back from this file

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
  • I'm not sure I've understood your question. Do you want to read a .dat file that has been generated with C and MFC from within a C# program ? Please edit your question and clarify what you want to do exactly, – Jabberwocky Jun 30 '15 at 13:36
  • ... and please show the data structure of `sDmdDataStore`. – Jabberwocky Jun 30 '15 at 13:47

1 Answers1

0

Roughly like that:

CArchive Ar(&SaveDataStoreDetail, CArchive::load);
...
Ar>>sDmdDataStore.iMachineNo;
Ar>>sDmdDataStore.csOptName;
Ar>>sDmdDataStore.csLocationofStone;
Jabberwocky
  • 48,281
  • 17
  • 65
  • 115
  • which namespace is needed for cArchive . as i am new in c# so dont know that. – Ravi Solanki Jun 30 '15 at 12:04
  • @RaviSolanki : I'm not sure I've understood your question. Do you want to read a .dat file that has been generated with C and MFC from within a C# program ? Please edit your question and clarify what you want to do exactly, – Jabberwocky Jun 30 '15 at 13:35
  • @RaviSolanki : this answer is probably wrong as I probably misunderstood your question. Please clarify. I will most likely delete this answer. – Jabberwocky Jun 30 '15 at 13:49
  • CArchive is part of the MFC C++ library. It is not part of C#. It is not easy to parse. You could consider adding an MFC DLL to parse it for you, or perhaps you can change the MFC program to generate a more open file format. – ScottMcP-MVP Jun 30 '15 at 23:40
  • i thought carchive is part of c# . sorry for wasting your time . – Ravi Solanki Jul 01 '15 at 04:27