Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
All,
I've finally started to make the switch from traditional Pro/TOOLKIT into OTK, and ran into a quick question.
I have a uifcDialog created and working fine. Inside of that dialog, I have a uifcLabel - lets call it "CONTENT". I can set text to CONTENT using the standard
uifcLabel_ptr label = uifcLabelFind(DIALOG_NAME, CONTENT);
label->SetTextAlignment(uifcAlignment::uifcALIGNMENT_LEFT);
xstring custom_text = "My Text";
label->SetText(custom_text);
However, this does not seem to work when I include special characters for instance:
xstring custom_text = "© Text";
label->SetText(custom_text);
I'm not sure if this has anything to do with it... but I loaded up the debugger, and investigated "custom_text". Inside of the __xstring_c it seems as though only the mbstr element has a value... the wstr element is NULL.
Any ideas?
As a side note... I'm testing in Creo 3, and am linking to protk_dll_NU.lib.
Thanks,
James
Solved! Go to Solution.
Hi James
A college of me had the same problem some days ago. He uses a double conversion : xstring(wstring(xstring())); That don't look like a good idea ... .
I think the problem is the charset conversion. So the fillup of the Label->label is wstring. you can push it in directly in UTF16 (std. wstring) by adding L to your string.
I don't know if this change anything. But it should. So the compiler convert it for you to the UTF16 char array. Anyway. all this isn't tested by me ^^ just ideas.
Br,
Eike
Hi James
A college of me had the same problem some days ago. He uses a double conversion : xstring(wstring(xstring())); That don't look like a good idea ... .
I think the problem is the charset conversion. So the fillup of the Label->label is wstring. you can push it in directly in UTF16 (std. wstring) by adding L to your string.
I don't know if this change anything. But it should. So the compiler convert it for you to the UTF16 char array. Anyway. all this isn't tested by me ^^ just ideas.
Br,
Eike
Eike,
Thanks for the response - funny enough, this worked! The code I had above was a simplification of the code I had been using... but I realized it was ultimately a combination of problems.
Thanks again for the response.