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!

Converting a program to use WideString from AnsiString.

Status
Not open for further replies.

Tremorblue

Programmer
Apr 30, 2004
56
0
0
GB
Iam using Borland Builder C++ 6.

I am trying to convert a large program from using WideString to AnsiString so that it will support unicode languages.

I have the Tnt unicode components for builder.

I need to know how to replace the ansi string functions that are not supported.

1. UpperCase
2. Number conversion
e.g
IntToStr(iHeight)
do I just do this ?
(WideString)IntToStr(FrontLabel->l_LabelHeightMM)

3. Have a function GetDetails(WideString *wCustomer,WideString *wAddress,WideString *wSettings)
but when I pass
WideString wCustomer,wAddress,wSettings;
GetFavouriteDetails(*wCustomer,*wAddress,*wSettings);

I get error Type mismatch wanted WideString* got wchar_t.
But the same funtion with AnsiString was ok ?

4. String constants "Hello" replace with (WideString)"Hello" is that correct ?

Thanks for any help.

/B
 
I am trying to convert a large program from using WideString to AnsiString so that it will support unicode languages.

I assume you mean from AnsiString to WideString.


Frankly, I've not had much luck with BCB6 and wide strings. I moved to C++Builder 2010 and have started using UnicodeStrings. They are wide strings that have the same functions as AnsiStrings.

If you plan on staying with BCB6, you may have to write your own functions to do #1 and 2 above. For #3, what happens if you use wchar_t?


James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top