| |

VerySource

 Forgot password?
 Register
Search
View: 732|Reply: 5

Questions about reading files? ? ? Ask for advice! !!

[Copy link]

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-7 06:50:01
| Show all posts |Read mode
Frequency Start time End time Visible time (s)
1 2452792.5434067 2452792.5497096 544.565
2 2452792.6125952 2452792.6210100 727.037

The format of the file is RTF. I want to read out the data into an array, and then convert the data format of the array and display it in a window. What should I do? ? ? ? ?
Reply

Use magic Report

0

Threads

24

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-1-7 11:45:02
| Show all posts
RichEdit's StreamIn, StreamOut can easily serialize RTF.
Reply

Use magic Report

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-7 16:27:01
| Show all posts
Can you tell us more about it?
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-10 21:18:01
| Show all posts
while (InFile >> times >> start time >> end time >> visible time)
{
...
}
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-10 21:27:01
| Show all posts
while (InFile >> times >> start time >> end time >> visible time)
{
...
}
Reply

Use magic Report

0

Threads

25

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-1-11 08:36:01
| Show all posts
static DWORD CALLBACK
MyStreamInCallback (DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb)
{
   CFile * pFile = (CFile *) dwCookie;

   * pcb = pFile-> Read (pbBuff, cb);

   return 0;
}

static DWORD CALLBACK
MyStreamOutCallback (DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb)
{
   CFile * pFile = (CFile *) dwCookie;

   // pbBuff is what you want
   return 0;
}

void CAboutDlg :: OnButton1 ()
{
CFile cFile (TEXT ("myfile.rtf"), CFile :: modeRead);
EDITSTREAM esin, esout;
CRichEditCtrl m_richedit;
Ranch
m_richedit.Create (
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_MULTILINE,
CRect (10,10,100,200), this, 1);
Ranch
esin.dwCookie = (DWORD)&cFile;
esin.pfnCallback = MyStreamInCallback;
m_richedit.StreamIn (SF_RTF, esin);
Ranch
esout.dwCookie = (DWORD)&cFile;
esout.pfnCallback = MyStreamOutCallback;
m_richedit.StreamOut (SF_TEXT, esout);
}
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list