How to read the Binary data from QFile to buffer of type BYTE*???
How to read the Binary data from QFile to buffer of type BYTE*???
Re: How to read the Binary data from QFile to buffer of type BYTE*???
I assume that BYTE is some typedef or macro that is equivalent to char.
QByteArray and QIODevice::readAll(). You can access the bytes through QByteArray::data().
Re: How to read the Binary data from QFile to buffer of type BYTE*???
How to convert QByteArrray to BYTE*???
How to convert QByteArrray to BYTE*???
How to convert QByteArrray to BYTE*???
Re: How to convert QByteArrray to BYTE*???
For me it looks like you expect that we're gonna solve all your issues for you - a while ago you've posted the same question here: link to thread
Please, can you kindly tell us what have you tried so far ? Because it looks like you are saying "I don't want help, I want a solution".
===
Note: I merged the threads, so this message was originally a response to the post while it was at a different place! (Lykurg)
Re: How to convert QByteArrray to BYTE*???
While reading the same file for the second time.. It returns null in the buffer..
I am using the following code::
QByteArray buf;
buf=file.readAll();
The above code is inside the while loop. If it enters for the second time.. buf value becomes null. Pls help me...
Re: How to convert QByteArrray to BYTE*???
So what you are trying to do is read the entire contents of the file more than once?
Re: How to convert QByteArrray to BYTE*???
Re: How to convert QByteArrray to BYTE*???
Well, then it is nonsense. Simply do something like:. If you still want to read the file again, use QIODevice::reset().
How to pass char * data to Byte* in QT??
How to pass char * data to Byte* in QT??
Re: How to read the full contents of the File 'n' times in QT??
How to read the full contents of the File 'n' times in QT??
Added after 19 minutes:
I am getting the values till the last loop runs. After that nothing is present in the buffer.
Am using the following code:
int pos1=file.pos();
buf=file.read(size);
int pos2=file.pos();
strcpy(buffer,buf.data());
PLS HELP ME..
Re: How to read the full contents of the File 'n' times in QT??
Stop asking the same question over and over - it rapidly annoys people who might be inclined to help.
You already have the answer to this in
http://www.qtcentre.org/threads/3947...TE*?highlight=
Re: How to pass char * data to Byte* in QT??
As I mentioned earlier, a Byte (or is that BYTE) is usually typedef or macro for a "char" on every platform I have handy. So a BYTE* or Byte* is a char*. Equating these two has nothing to do with Qt, it is straight C++.
Re: How to pass char * data to Byte* in QT??
So, the order of responses gets a little messy here because I merged the thread. But we really do not need 4 (in letters: four) threads on that topic.