cancel
Showing results for 
Search instead for 
Did you mean: 

Passing UnicodeChar to function

heyo
Senior

Hello everyone,

Im faced with problem. I want to save headline name typed by keyboard

This is how I copy buffer to wildcard

0693W00000WLQa5QAH.pngWhen I sent keyboard[2] to view like this:

0693W00000WLQaAQAX.pngAnd throught presenter I save string to model:

0693W00000WLQaFQAX.pngPresenter:

0693W00000WLQaUQAX.pngModel:

0693W00000WLQaoQAH.pngAnd in model I create Unicode::UnicodeChar* array like this. Am I doing this right?:

0693W00000WLQatQAH.pngWhen I store this data to model I take this info in other screen

Here I take headline name and send it to getControllerText function

0693W00000WLQbNQAX.pnghere is this function:

0693W00000WLQW4QAP.pngIt is OK how I store Unicode::UnicodeChar* strings? Because when I want to save 2 strings then second string replace first one and it becomes the same. Maybe someone see the problem?

When I store one string:

0693W00000WLQcGQAX.pngThe second one replace first string and second and I didint see why..

0693W00000WLQcQQAX.png

1 ACCEPTED SOLUTION

Accepted Solutions

No you dont send buff. Debug your code and will see, that in your .Headline is pointer address = kebuff[2]

You need on any transfer stage create strcpy.

Unicode | TouchGFX Documentation

and remove * from Unicode::UnicodeChar in struct

View solution in original post

7 REPLIES 7
MM..1
Chief III

I mean no. You send over presenter pointer into keyboard buff and this stay one.

AMM, but I send keyboard buff over presenter to model and store them into array.

No you dont send buff. Debug your code and will see, that in your .Headline is pointer address = kebuff[2]

You need on any transfer stage create strcpy.

Unicode | TouchGFX Documentation

and remove * from Unicode::UnicodeChar in struct

OK. I'll try. Thank you

@MM..1​ I'm stuck. Here is what I change:

Change struct as you said:

0693W00000WLWb9QAH.pngAnd change code in model.hpp

0693W00000WLWZEQA5.pngAnd this is what i got now:

0693W00000WLWYQQA5.pngWhen I create first with name "1" it is ok. But when I create second and name it "2", the first headline becomes "12" and second "2" and so on. It adding number which I used before and I dont know why.

Unicode::UnicodeChar Headline[10] is array of unicode character for one name with max 10 letters or for 10 names with only one char...
You need two dim [10][10] array here or redesign to use struct array.

It works. Thank you.