Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

operator=(AnsiString) not inheting!

Posted on 2002-06-18
3
Medium Priority
?
879 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
DrDelphi earned 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

715 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