 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Stephen Craig Guest
|
Posted: Mon Jul 11, 2005 4:59 am Post subject: Incompatible Parameter List woes |
|
|
Hi
I had a working program to which I added a new component (DBISAM). When I
compiled I began to get messages from the compiler
"[C++ Error] Unit1.cpp(14928): E2015 Ambiguity between 'TErrorEvent' and
'Scktcomp::TErrorEvent'"
The line of code is
void __fastcall TForm1::ClientSocketError(TObject *Sender,
TCustomWinSocket *Socket, TErrorEvent ErrorEvent, int &ErrorCode)
No problem, I thought, I will just add the correct namespace
void __fastcall TForm1::ClientSocketError(TObject *Sender,
TCustomWinSocket *Socket, Scktcomp::TErrorEvent ErrorEvent, int
&ErrorCode)
Unfortunately the ide now complains whenever I build. I get the error ...
"Method referenced by ClientSocket->OnError has incompatible parameter list.
Remove the reference?"
I just answer "No" and everything compiles and builds. But it is very
annoying and sooner or later I'm going to get it wrong and answer "Yes"
How can I convince, trick, persuade the IDE that the parameter list matches.
Thanks
Steve
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Jul 11, 2005 7:17 am Post subject: Re: Incompatible Parameter List woes |
|
|
"Stephen Craig" <stevecraig (AT) ozemail (DOT) com.au> wrote
| Quote: | No problem, I thought, I will just add the correct namespace
snip
Unfortunately the ide now complains whenever I build. I get the error ...
|
You put the namespace in the wrong place. Put it in the event handler's
declaration in the .h header file, not its implementation in the .cpp source
file.
Gambit
|
|
| Back to top |
|
 |
Stephen Craig Guest
|
Posted: Mon Jul 11, 2005 7:46 am Post subject: Re: Incompatible Parameter List woes |
|
|
Thanks for pointing that out Gambit. I infact put it in both the
implementation and the declaration. Anyway, I've corrected that, but it
made no difference, I still get the same error from the ide (at least I
think its the ide) ...
"Method referenced by ClientSocket->OnError has incompatible parameter list.
Remove the reference?"
I assume this is because the parameter list that I have specified in the
declaration is different to the one that the ide expects because i've added
'Scktcomp::TErrorEvent' and its expecting 'TErrorEvent'
void __fastcall ClientSocketError(TObject *Sender,
TCustomWinSocket *Socket, Scktcomp::TErrorEvent ErrorEvent,
int &ErrorCode);
Steve
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote
| Quote: |
"Stephen Craig" <stevecraig (AT) ozemail (DOT) com.au> wrote in message
news:42d1fcbb$1 (AT) newsgroups (DOT) borland.com...
No problem, I thought, I will just add the correct namespace
snip
Unfortunately the ide now complains whenever I build. I get the error
....
You put the namespace in the wrong place. Put it in the event handler's
declaration in the .h header file, not its implementation in the .cpp
source
file.
Gambit
|
|
|
| Back to top |
|
 |
Stephen Craig Guest
|
Posted: Mon Jul 11, 2005 8:11 am Post subject: Re: Incompatible Parameter List woes |
|
|
Correction, unless I specify it in the implementation as well, the complier
winges about the ambiguity.
I've got around the problem by assigning the events myself at runtime. I'm
still curious if there is another way to overcome the problem.
Steve
"Stephen Craig" <stevecraig (AT) ozemail (DOT) com.au> wrote
| Quote: | Thanks for pointing that out Gambit. I infact put it in both the
implementation and the declaration. Anyway, I've corrected that, but it
made no difference, I still get the same error from the ide (at least I
think its the ide) ...
"Method referenced by ClientSocket->OnError has incompatible parameter
list.
Remove the reference?"
I assume this is because the parameter list that I have specified in the
declaration is different to the one that the ide expects because i've
added
'Scktcomp::TErrorEvent' and its expecting 'TErrorEvent'
void __fastcall ClientSocketError(TObject *Sender,
TCustomWinSocket *Socket, Scktcomp::TErrorEvent ErrorEvent,
int &ErrorCode);
Steve
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote in message
news:42d21e89$1 (AT) newsgroups (DOT) borland.com...
"Stephen Craig" <stevecraig (AT) ozemail (DOT) com.au> wrote in message
news:42d1fcbb$1 (AT) newsgroups (DOT) borland.com...
No problem, I thought, I will just add the correct namespace
snip
Unfortunately the ide now complains whenever I build. I get the error
...
You put the namespace in the wrong place. Put it in the event handler's
declaration in the .h header file, not its implementation in the .cpp
source
file.
Gambit
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Jul 11, 2005 4:34 pm Post subject: Re: Incompatible Parameter List woes |
|
|
"Stephen Craig" <stevecraig (AT) ozemail (DOT) com.au> wrote
| Quote: | I've got around the problem by assigning the events myself at
runtime. I'm still curious if there is another way to overcome
the problem.
|
Don't include DBISAM in the same unit as TClientSocket ;-)
Gambit
|
|
| Back to top |
|
 |
Stephen Craig Guest
|
Posted: Tue Jul 12, 2005 6:27 am Post subject: Re: Incompatible Parameter List woes |
|
|
| Quote: |
Don't include DBISAM in the same unit as TClientSocket ;-)
:-) |
Unfortunately that's not an option for me.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|