Hi,
I’ve problems compiling my code. I have a TList object called “TLtrend” that contains serveral objects of my class “PVSSTrend” (kind of graph).
Now I want to access the trends via those list.
I tried to do as the “THStack::Paint()” method does. There, a TObjLink object is created, the link is extracted from the TList object and then the “TObjLink::GetObject()”-method is used to retrieve the object pointer. Then I want to use this pointer to call the trend-objects “PVSSTrend::Cancel()”-method.
Here is the interesting part of the code:
[code]TObjOptLink tempObjLink = (TObjOptLink)TLtrend->FirstLink();
PVSSTrend *tempTrend;
//cancel all trends:
while (tempObjLink) {
tempTrend = (PVSSTrend*)tempObjLink->GetObject();
tempTrend->Cancel();
tempObjLink = (TObjOptLink*)tempObjLink->Next();
}[/code]
The problem is now, that my compiler (VS.Net) claims:
[quote]error C2039: ‘GetObjectA’ : is not an element of ‘TObjOptLink’
[/quote]
I copied/pasted both the code and the error message.
So the first thing that is very interesting is, that there is no “A” in the code (where does this “GetObjectA” come from?).
The second thing is, that I changed the “GetObject()” with a “GetOption()” which is a method of TObjOptLink and everything works fine (except of the fact, that the code makes nothing meaningful anymore).
I’ve looked into the TList.h file and there I see no reason why “GetOption()” works, while “GetObject()” fails.
Of course I restarted VS.Net but that didn’t help.
Has anyone an idea what this could be?
Thanks in advance,
Tobias