Hello,
the line
SendClass(SELF,#Setup,#DFSUBLister)
compiles without error, but the Method Setup of the Super-Super-Class DFSUBLister is not called.
What am I doing wrong
TIA
Karl
Sendclass
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
Sendclass
Hi Karl,
don ´t you get an obsolete compiler warning ? When i search "Function SendClass" on Github the result is:
regards
Karl-Heinz
don ´t you get an obsolete compiler warning ? When i search "Function SendClass" on Github the result is:
Code: Select all
/// <exclude/>
[ObsoleteAttribute( "'SendClass()' is not supported and always returns NIL")] ;
FUNCTION SendClass( o , symMethod , symClassName ) AS USUAL CLIPPER
RETURN NIL
Karl-Heinz
Sendclass
Hi Karl,
Maybe you have explicitly disabled showing that warning (it's number 618) in the project settings?
Any reason why you are using SendClass() instead of Send()? Send() does work fine. I will have another look, but I think it's not possible to implement the semantics of SendClass() in .Net.
Maybe you have explicitly disabled showing that warning (it's number 618) in the project settings?
Any reason why you are using SendClass() instead of Send()? Send() does work fine. I will have another look, but I think it's not possible to implement the semantics of SendClass() in .Net.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Sendclass
Hi Chris,
yes, warning 618 is disabled. Can't remeber to have done this...
What I do is certainly a bit ugly, but sometimes it makes sense in my code to skip the super:method and call super:super:method.
Is there any chance to do this ?
yes, warning 618 is disabled. Can't remeber to have done this...
What I do is certainly a bit ugly, but sometimes it makes sense in my code to skip the super:method and call super:super:method.
Is there any chance to do this ?
Sendclass
Hi Karl,
There is a way, but is very complicated. Reflection (the mechanism used by Send() and late binding in general) can't do it, it's designed to always respect the inheritance rules. Only way I am aware of is to create dynamic IL code to do that, but this can be extremely difficult to implement correctly, especially if there are different method signatures involved.
Can you show some of your method declarations? Those that you may call with SendClass() I mean. If they are all standard untyped methods like usually done in VO, it will be a little easier to implement it. But if they are strongly typed, absolutely no way, sorry!
There is a way, but is very complicated. Reflection (the mechanism used by Send() and late binding in general) can't do it, it's designed to always respect the inheritance rules. Only way I am aware of is to create dynamic IL code to do that, but this can be extremely difficult to implement correctly, especially if there are different method signatures involved.
Can you show some of your method declarations? Those that you may call with SendClass() I mean. If they are all standard untyped methods like usually done in VO, it will be a little easier to implement it. But if they are strongly typed, absolutely no way, sorry!
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Sendclass
Hi Chris,
then it makes definitely sense to review my VO-Code. I should certainly be able to find other solutions. Ages ago it seemed to be the easiest way and it worked for years. I'll be back, if I have severe problems with the changes...
then it makes definitely sense to review my VO-Code. I should certainly be able to find other solutions. Ages ago it seemed to be the easiest way and it worked for years. I'll be back, if I have severe problems with the changes...
Sendclass
Hi Karl,
Yeah, a redesign in this particular area sounds like the best solution. If it turns out too be too difficult as well, maybe just give a sample of your methods and we'll have a look if it is possible to create a custom solution for those cases. But, yeah, a general all around solution is way to complicated unfortunately.
Yeah, a redesign in this particular area sounds like the best solution. If it turns out too be too difficult as well, maybe just give a sample of your methods and we'll have a look if it is possible to create a custom solution for those cases. But, yeah, a general all around solution is way to complicated unfortunately.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Sendclass
Karl,
The SendClass() function is marked with an Obsolete attribute. You should have a warning that this function is Obsolete.
Maybe you did not look at the compiler warnings ?
Robert
The SendClass() function is marked with an Obsolete attribute. You should have a warning that this function is Obsolete.
Maybe you did not look at the compiler warnings ?
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu