Solved

operator=(AnsiString) not inheting!

Posted on 2002-06-18
3
869 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 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

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

729 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