Solved

operator=(AnsiString) not inheting!

Posted on 2002-06-18
3
843 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
ID: 7089596
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
ID: 7089768
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
ID: 7089842
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

911 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

21 Experts available now in Live!

Get 1:1 Help Now