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:

Qt Code:
  1. QString str = "NONONONONO";
  2. unsigned char * ucTest;
  3. 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.

Qt Code:
  1. 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.