I try to use VisuElems.cmpDynamictext.DynamicTextGetTextW function to read a text from text list.
In my project I noticed that it returns pointer to "" until I add a Visualization and select a language in the Visualization Manager. Then it works.
But my problem is I would like to use the function in a library and call it from inside the library.
The function called from inside a library always returns non-zero pointer.
I suspect this is because of language (I may be wrong), because for the library no language is selected.
I tried to set a language with VisuElems.cmpDynamictext.DynamicTextChangeLanguage function, but without success.
Does anyone have an idea how to resolve it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried both functions (DynamicTextGetTextW and DynamicTextGetDefaultTextW), but both of them return pointer to an empty string.
Strangely, I noticed that if I put the text list in my project rather than in the library, then the functions call from the library return correct text.
I also called VisuElems.CURRENTLANGUAGE and DynamicTextGetCurrentLanguage functions inside the library and they both seem to have a correct language selected (same as in the project).
So my understanding now is: there is a problem with accessing/receiving the text from the text list from inside the library, because the text list placed in the project works.
I still do not know how to resolve it though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have not tried it in a library but can you check to see if the textlist is being put onto the device? The textlist might be adding the library name before it and can verify that by looking in the visu folder. For example you might need to call "library.txtlistname" instead of just "txtlistname". Just a thought.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Comingback4u hat geschrieben:
(...) The textlist might be adding the library name before it and can verify that by looking in the visu folder. For example you might need to call "library.txtlistname" instead of just "txtlistname". Just a thought.
That was exactly what happened!
I had to add the library namespace before text list name, as the library adds its prefix with dot.
That resolved the problem.
Thank you very much for your support!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know, the post is old! But ist there somebody who could tell me what's wrong?
I want to change the language but i couldn't do it.
I can see the language (Deutsch, Enlisch,...) i choose with a button in my visu.
But i can see no text from my textlist.
Thanks a lot. Greetings Timo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I try to use VisuElems.cmpDynamictext.DynamicTextGetTextW function to read a text from text list.
In my project I noticed that it returns pointer to "" until I add a Visualization and select a language in the Visualization Manager. Then it works.
But my problem is I would like to use the function in a library and call it from inside the library.
The function called from inside a library always returns non-zero pointer.
I suspect this is because of language (I may be wrong), because for the library no language is selected.
I tried to set a language with VisuElems.cmpDynamictext.DynamicTextChangeLanguage function, but without success.
Does anyone have an idea how to resolve it?
From past experience when no "language" is selected I had to call DynamicTextGetDefaultTextW instead of DynamicTextGetTextW.
Thank you for your reply, Comingback4u.
I have tried both functions (DynamicTextGetTextW and DynamicTextGetDefaultTextW), but both of them return pointer to an empty string.
Strangely, I noticed that if I put the text list in my project rather than in the library, then the functions call from the library return correct text.
I also called VisuElems.CURRENTLANGUAGE and DynamicTextGetCurrentLanguage functions inside the library and they both seem to have a correct language selected (same as in the project).
So my understanding now is: there is a problem with accessing/receiving the text from the text list from inside the library, because the text list placed in the project works.
I still do not know how to resolve it though.
I have not tried it in a library but can you check to see if the textlist is being put onto the device? The textlist might be adding the library name before it and can verify that by looking in the visu folder. For example you might need to call "library.txtlistname" instead of just "txtlistname". Just a thought.
That was exactly what happened!
I had to add the library namespace before text list name, as the library adds its prefix with dot.
That resolved the problem.
Thank you very much for your support!
I know, the post is old! But ist there somebody who could tell me what's wrong?
I want to change the language but i couldn't do it.
I can see the language (Deutsch, Enlisch,...) i choose with a button in my visu.
But i can see no text from my textlist.
Thanks a lot. Greetings Timo
Thank you very much! The quotes fixed the problem!