If you were using Qt classes, you wouldn't have this problem.
QChar SoftwareName
[260*2];
memset(SoftwareName,0x00,260*2);
memcpy((void*)SoftwareName,(const void*)&Header.bSoftwareName,(260*2));
QChar SoftwareName[260*2];
memset(SoftwareName,0x00,260*2);
memcpy((void*)SoftwareName,(const void*)&Header.bSoftwareName,(260*2));
To copy to clipboard, switch view to plain text mode
QChar is a class --- it isn't safe to initialize it using memcpy. Not mentioning that &Header.bSoftwareName is char **.
This might work:
if( codec != 0 ) {
name = codec->toUnicode( Header.bSoftwareName, 2*260 );
}
QTextCodec *codec = QTextCodec::codecForName( "UTF-16" );
QString name;
if( codec != 0 ) {
name = codec->toUnicode( Header.bSoftwareName, 2*260 );
}
To copy to clipboard, switch view to plain text mode
Bookmarks