Solved

operator=(AnsiString) not inheting!

Posted on 2002-06-18
3
835 Views
Last Modified: 2008-02-01
Hello-

I am using Borland C++ Builder 5, and have run into a bit of a problem.  I have extended the TComboBox class to add a little bit of functionality that I needed.  That worked without a hitch.  The problem that I am running into is that the opeartor= does not seem to be working in the extended class.

If i write a line like:
WebgistixPackageType[currentPosition] = (WebgistixPackageType->MoreItems->Strings[WebgistixPackageType->ItemIndex]);

I get an error like:
[C++ Error] WebgistixWarehouse.cpp(820): E2285 Could not find a match for 'WebgistixComboBox::operator =(AnsiString)'

So it seems that I need to overload (or atleast create) the '=' operator for AnsiString.  Can someone give me some help on this?  Thanks!

Nick
0
Comment
Question by:NJordan72
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
DrDelphi earned 100 total points
Comment Utility
It looks to me that you are trying to assign a single Item. Have you tried:

WebgistixPackageType->Items[currentPosition]=yada...

 
0
 

Author Comment

by:NJordan72
Comment Utility
DrDelphi-

That just brings out this error:

[C++ Error] WebgistixWarehouse.cpp(711): E2285 Could not find a match for 'WebgistixComboBox::operator =(TStrings)'

I can't figure out why the operator= isn't being inherited, by WebgistixComboBox.
0
 

Author Comment

by:NJordan72
Comment Utility
Actually, you are sorta right.  I was supposed to be assigning the value to an array that was similarly named.  In my haste i typed in the wrong value.  Bad naming conventions == bad programming!  Thanks!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now