Click here to Skip to main content
15,897,032 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: copy/store to a file Pin
kakan30-Aug-06 20:25
professionalkakan30-Aug-06 20:25 
GeneralRe: copy/store to a file Pin
thathvamsi30-Aug-06 20:37
thathvamsi30-Aug-06 20:37 
GeneralRe: copy/store to a file Pin
kakan30-Aug-06 20:44
professionalkakan30-Aug-06 20:44 
GeneralRe: copy/store to a file Pin
thathvamsi30-Aug-06 20:49
thathvamsi30-Aug-06 20:49 
GeneralRe: copy/store to a file Pin
kakan30-Aug-06 20:55
professionalkakan30-Aug-06 20:55 
GeneralRe: copy/store to a file Pin
thathvamsi30-Aug-06 21:00
thathvamsi30-Aug-06 21:00 
GeneralRe: copy/store to a file Pin
Rinu_Raj30-Aug-06 21:06
Rinu_Raj30-Aug-06 21:06 
GeneralRe: copy/store to a file Pin
kakan30-Aug-06 21:15
professionalkakan30-Aug-06 21:15 
It depends, partly on the data you got, partly on how you want to represent it in the file.

You say you have "data values (numbers)" in the buffer. What kind of numbers?
How long are they?

One (IMO) good way to get a good grip on data is to do a hex dump of the data, and save the hex dump in the file.

Another way would be to open your saved file with a hex dump program, instead of looking at it with Notepad.

The you will see the values in it.

But I have one question for you. It's about this line of code:
TestFile.Write(&Rx_Buf,3000);

How is Rx_Buf declared? I assume it's an unsigned char[]?
In that case, remove the &-char, like this:
TestFile.Write(Rx_Buf,3000);

Else you will write something very different than your buffer in the file.
Rx_Buf is the same as the address of the first item in the array (Rx_Buf[0]).
So if you write &Rx_Buf, then C/C++ will get the *contents* of Rx_Buf[0] (and possibly following elements in the array), interpret them as an address, and then write the contents of that address to the file. That's not what you want...




Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

GeneralRe: copy/store to a file Pin
thathvamsi30-Aug-06 21:34
thathvamsi30-Aug-06 21:34 
GeneralRe: copy/store to a file Pin
kakan30-Aug-06 22:20
professionalkakan30-Aug-06 22:20 
GeneralRe: copy/store to a file Pin
thathvamsi30-Aug-06 23:17
thathvamsi30-Aug-06 23:17 
GeneralRe: copy/store to a file Pin
kakan30-Aug-06 23:35
professionalkakan30-Aug-06 23:35 
GeneralRe: copy/store to a file Pin
thathvamsi30-Aug-06 23:41
thathvamsi30-Aug-06 23:41 
GeneralRe: copy/store to a file Pin
kakan30-Aug-06 23:45
professionalkakan30-Aug-06 23:45 
GeneralRe: copy/store to a file Pin
thathvamsi31-Aug-06 16:41
thathvamsi31-Aug-06 16:41 
GeneralRe: copy/store to a file Pin
kakan31-Aug-06 21:55
professionalkakan31-Aug-06 21:55 
GeneralRe: copy/store to a file [modified] Pin
kakan31-Aug-06 22:11
professionalkakan31-Aug-06 22:11 
GeneralRe: copy/store to a file Pin
Rinu_Raj30-Aug-06 19:13
Rinu_Raj30-Aug-06 19:13 
Questionreinterpret_cast to fill listview Pin
Jumpin' Jeff30-Aug-06 16:24
Jumpin' Jeff30-Aug-06 16:24 
QuestionRe: reinterpret_cast to fill listview Pin
prasad_som30-Aug-06 19:09
prasad_som30-Aug-06 19:09 
AnswerRe: reinterpret_cast to fill listview Pin
Jumpin' Jeff31-Aug-06 1:33
Jumpin' Jeff31-Aug-06 1:33 
GeneralRe: reinterpret_cast to fill listview Pin
prasad_som31-Aug-06 2:07
prasad_som31-Aug-06 2:07 
GeneralRe: reinterpret_cast to fill listview Pin
Jumpin' Jeff31-Aug-06 9:33
Jumpin' Jeff31-Aug-06 9:33 
GeneralRe: reinterpret_cast to fill listview Pin
prasad_som31-Aug-06 19:10
prasad_som31-Aug-06 19:10 
GeneralRe: reinterpret_cast to fill listview Pin
Jumpin' Jeff1-Sep-06 1:24
Jumpin' Jeff1-Sep-06 1:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.