Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to convert BYTE* to QByteArray?
Posted

As char is a 1-byte type, you can type-cast BYTE* to char* and pass it to one of the QByteArray constructors.
All the information is here: http://doc.qt.nokia.com/latest/qbytearray.html[^].

—SA
 
Share this answer
 
v2
Comments
Espen Harlinn 18-Jul-11 10:48am    
Right, my 5
Sergey Alexandrovich Kryukov 18-Jul-11 11:25am    
Thank you, Espen.
--SA
void TryIt(QByteArray* pArray, BYTE* pData)
{
  if (pArray && pData) {
    pArray->append((const char*) pData);
  }
}
 
Share this answer
 
Comments
Gokulnath007 18-Jul-11 3:26am    
Thanks, but while converting, QByteArray carries only ",". Whats wrong with this.
Sergey Alexandrovich Kryukov 18-Jul-11 11:26am    
???

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900