Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unable to correctly unescape backslash character in dialogue 1

Status
Not open for further replies.

MakeItSo

Programmer
Oct 21, 2003
3,316
0
0
DE
Hello friends,

I am having a bit of a problem here:
I want to display a text like this : " using "\n" will..." on a label in a resource dialogue.
However, the \n will be interpreted into line feed and displayed as a pipe...
[pipe]

I have tried to avoid this by typing "\\n". Then, however, I receive two backslashes, i.e. one is NOT escaped as it should...

I have also tried using the numerical reference
\134n
and
\x5cn
Both will then appear just as I type them, i.e. will not get intrepreted at all.

*sigh*

Do you guys have an idea of what I am doing wrong? I am running out of alternatives here.

Thank you very much!
Andy

[blue]Speak out against Human Rights violations in China/Tibet
[/blue]
 
Try this

"using ""\\n"" will ...."

Works on my machine.


HyperEngineer
If it ain't broke, it probably needs improvement.
 
Thanks, HyperEngineer.

But like I said: it doesn't on mine....
Perhaps something in the resource properties, that has this strange effect?

\n and \t yield in line feed and tab.
\\ yields in the display of one "\"
\\n results in "\\n" with two backslashes...

Something as an addition:
I have to access this dialog in a DLL, not in an RC.
The original resource files are not available, only the compiled DLL.
Does this change anything?

Thanks!

[blue]Speak out against Human Rights violations in China/Tibet
[/blue]
 
Did you notice the double ("") on either side of the \n sequence. You were only using a single ". Therefore your code seen "using " as a segment string then \n as a newline, then " will..." as another segment string.

Did you try it with the double quotes where indicated?

HyperEngineer
If it ain't broke, it probably needs improvement.
 
Oh, didn't notice that at first, thanks.

Now guess what:
I end up with double quotes and double backslashes during runtime! :-/
It displays well in Catalyst (the software in which the dll texts are edited), but not when loaded from the parent software during runtime...

I have also tried using double single quotes '' around it.
In any way, I just cannot achieve a single backslashed output...

P.S: Using double quotes and single backslash will get me a quoted pipe...

Murphy's Law - you gotta love it...
[banghead]

[blue]Speak out against Human Rights violations in China/Tibet
[/blue]
 
Andy,

I have not used Catalyst. What is the parent software? I don't know the mechanism you use to get the string from the DLL to the parent program. As you stated it works fine in Catalyst. And it worked fine for me in VS 6.0. Can you post some code that interacts with the string?


HyperEngineer
If it ain't broke, it probably needs improvement.
 
HyperEngineer:
Alchemy "Catalyst" is a software that allows localisation of RCs, DLLs, EXEs a.s.o.:

This is one software we use to edit DLLs. Other (my perferred) choices are RC-WinTrans or Passolo:
Usually these tools work quite well. This seems to be one special case, in which all fail!

However: I have installed VS .Net and with this, everything worked just as expected, a simple double-slash did it - as it should have from the very beginning...
128.gif

-19.gif
[flush]

It is obviously a wide-spread bug in localisation software.

Thanks for your patience!
[thumbsup2]

Andy

[blue]Speak out against Human Rights violations in China/Tibet
[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top