4
QString processName = "test.exe";
QString::toWCharArray(processName);

次のエラーが表示されます。

error: C2664: 'QString::toWCharArray' : cannot convert parameter 1 from 'QString' to 'wchar_t *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
4

4 に答える 4

11

使い方が間違っています。変換したい を呼び出しtoWCharArrayて、割り当てた配列の最初の要素へのポインタを渡す必要があります。QString

wchar_t array[9];
QString processName = "test.exe";
processName.toWCharArray(array);

arrayこれはの内容で満たされprocessNameます。

于 2013-04-25T22:32:37.947 に答える