Hi,
Sorry to bring this issue to light again, but I need to fix this.
I'm with a problem to convert one type QString to unsigned char *.
I've been reading various documents about this issue and making tests for days, but can not solve the problem.
Here's the situation:
unsigned char * ucTest;
ucTest = (unsigned char *) str.toLatin1().data();
QString str = "NONONONONO";
unsigned char * ucTest;
ucTest = (unsigned char *) str.toLatin1().data();
To copy to clipboard, switch view to plain text mode
The result of the conversion seems to work correctly.
But when I pass the variable to the process ucTest result is not correct!
Now, if I define directly and pass it through the same process, so now it works.
unsigned char * ucText = "NONONONONO";
unsigned char * ucText = "NONONONONO";
To copy to clipboard, switch view to plain text mode
now I pass the variable to the process the result is correct!
Why does this happen?
Please any of you could try to help me solve this?
Thank a lot.
Bookmarks