| View previous topic :: View next topic |
| Author |
Message |
Jim Davis Guest
|
Posted: Fri May 18, 2007 6:19 am Post subject: C++ class iterator - How use ? |
|
|
I want to use an imported C++ class iterator
GetNext() ,
but I don't have the correct syntax ,
and I get BCB6 compile errors .
Any help coding this appreciated ;
here is snip from imported header :
class ID3_CPP_EXPORT ID3_Tag
{
public:
class Iterator
{
public:
virtual ID3_Frame* GetNext() = 0;
}; |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri May 18, 2007 6:31 am Post subject: Re: C++ class iterator - How use ? |
|
|
"Jim Davis" <jim46dd (AT) hotmail (DOT) com> wrote in message
news:Xns9933BA6F21BACjim46ddhotmailcom (AT) 207 (DOT) 105.83.66...
| Quote: | here is snip from imported header :
|
Please show more of the Iterator class declaration. At the very
least, you need to show the constructor. I am assuming that it takes
a ID3_Tag as a parameter, so that it knows which tag to operate on.
In which case, the syntax will be similar to the following:
ID3_Tag tag(...whatever...);
ID3_Tag::Iterator iter(tag);
ID3_Frame frame = iter.GetNext();
Gambit |
|
| Back to top |
|
 |
Alan Bellingham Guest
|
Posted: Fri May 18, 2007 2:06 pm Post subject: Re: C++ class iterator - How use ? |
|
|
Jim Davis <jim46dd (AT) hotmail (DOT) com> wrote:
| Quote: | I want to use an imported C++ class iterator
GetNext() ,
but I don't have the correct syntax ,
and I get BCB6 compile errors .
Any help coding this appreciated ;
here is snip from imported header :
class ID3_CPP_EXPORT ID3_Tag
{
public:
class Iterator
{
public:
virtual ID3_Frame* GetNext() = 0;
};
|
The first question has to be - how has ID3_CPP_EXPORT been defined?
Alan Bellingham
--
ACCU Conference 2008: 2-5 April 2008 - Oxford (probably), UK |
|
| Back to top |
|
 |
Jim Davis Guest
|
Posted: Sat May 19, 2007 8:10 am Post subject: Re: C++ class iterator - How use ? |
|
|
| Quote: | you need to show the constructor.
Iterator* CreateIterator(); |
ConstIterator* CreateIterator() const;
| Quote: | I am assuming that it takes a ID3_Tag as a parameter
In which case, the syntax will be similar to the following:
ID3_Tag tag(...whatever...);
ID3_Tag::Iterator iter(tag);
ID3_Frame frame = iter.GetNext();
|
//---- this syntax compiles in BCB6 -------------
ObjectDad* ODad ;
ObjectSon* OSon ;
ObjectDad::Iterator* ODadIter = ODad->CreateIterator() ;
OSon = ODadIter->GetNext(); // W8060 Possibly incorrect assign - const???
if(NULL == OSon) ... |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sun May 20, 2007 12:54 am Post subject: Re: C++ class iterator - How use ? |
|
|
"Jim Davis" <jim46dd (AT) hotmail (DOT) com> wrote in message
news:Xns99357F941594jim46ddhotmailcom (AT) 207 (DOT) 105.83.66...
| Quote: | Iterator* CreateIterator();
ConstIterator* CreateIterator() const;
|
Are those members of the ID3_Tag class itself?
| Quote: | //---- this syntax compiles in BCB6 -------------
|
That is not the class you showed earlier.
| Quote: | OSon = ODadIter->GetNext(); // W8060 Possibly incorrect assign -
const??? |
You did not show the delaration of GetNext().
Gambit |
|
| Back to top |
|
 |
|