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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AnsiString in Visual C++ ?

Status
Not open for further replies.

hencox

Technical User
Sep 5, 2001
6
SE
Hello!

In my project in Visual C++ I need to include an old header file that defines a struct that among other things uses AnsiString. The header file doesn't state any includes that might contain this class (or whatever it is).

I get a compiler error when trying to compile this. Is there something that I could replace AnsiString with?

Regards
Henrik
 
If you're saying that you are trying to include the headers for a library that implements a class called 'AnsiString'.. well you might try the STL's 'std::string'. But if your code was heavily dependent on this 'AnsiString' type, you will probably have to update a lot of it.

I REALLY hope that helps.
Will
 
AnsiString is a Borland Data Type that is not supported by Visual C++ and unfortunately you probably will have to change all occurances and update the methods called on them as most of them don't exist outside of Borland.
as apatterno said one alternative is to use the STL

regards
Dave
 
Thanks for your help! :)

I tried changing AnsiString to std::string, and using the include file <string> the errors are gone. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top