Classes inheritance. How to ?
Classes inheritance. How to ?
Where can I find a tutorial and/or documentation about how to create and inherit FWH classes ?
Is there one around ?
I am triing to inherit a class from another because I need to add a method.
I am getting an error that I don´t have if I use the original class.
The object seems not ot be created at all...
The code is something like this:
Class CL2 from CL1
METHOD PrintCl()
ENDCLASS
METHOD PrintCl() class CL2
alert("CL2")
return NIL
Questions:
Al the CL1 methods are avaiable in CL2 ?
Do I need a constructor/destructor method or the CL1 one is used ?
[[]] Maurício Faria
Is there one around ?
I am triing to inherit a class from another because I need to add a method.
I am getting an error that I don´t have if I use the original class.
The object seems not ot be created at all...
The code is something like this:
Class CL2 from CL1
METHOD PrintCl()
ENDCLASS
METHOD PrintCl() class CL2
alert("CL2")
return NIL
Questions:
Al the CL1 methods are avaiable in CL2 ?
Do I need a constructor/destructor method or the CL1 one is used ?
[[]] Maurício Faria
Re: Classes inheritance. How to ?
Don't forget to add:concentra wrote:Where can I find a tutorial and/or documentation about how to create and inherit FWH classes ?
Is there one around ?
I am triing to inherit a class from another because I need to add a method.
I am getting an error that I don´t have if I use the original class.
The object seems not ot be created at all...
The code is something like this:
Class CL2 from CL1
METHOD PrintCl()
ENDCLASS
METHOD PrintCl() class CL2
alert("CL2")
return NIL
Questions:
Al the CL1 methods are avaiable in CL2 ?
Do I need a constructor/destructor method or the CL1 one is used ?
[[]] Maurício Faria
CLASSDATA lRegistered AS LOGICAL
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Classes inheritance. How to ?
Best documentation is FWH source code.concentra wrote:Where can I find a tutorial and/or documentation about how to create and inherit FWH classes ?
Can you build a little real (compilable) sample of the problem?concentra wrote:I am triing to inherit a class from another because I need to add a method.
I am getting an error that I don´t have if I use the original class.
The object seems not ot be created at all...
The code is something like this:
Class CL2 from CL1
METHOD PrintCl()
ENDCLASS
METHOD PrintCl() class CL2
alert("CL2")
return NIL
Yes.concentra wrote:Questions:
Al the CL1 methods are avaiable in CL2 ?
Yes, you need of a constructor.concentra wrote:Do I need a constructor/destructor method or the CL1 one is used ?
EMG
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Maurício,
There are a couple of articles that I wrote on this available on my website here:
http://ourworld.compuserve.com/homepage ... rogram.htm
The article, "Introduction to Object-Oriented Programming Using FiveWin" is in two parts.
>I am getting an error that I don´t have if I use the original class.
I see nothing wrong with the code you show so the problem must be in the code you didn't show us. Can you provide us with a small REAL example. Which FW class are trying to inherit from? What is the error you are getting? What version of FW are you using?
James
There are a couple of articles that I wrote on this available on my website here:
http://ourworld.compuserve.com/homepage ... rogram.htm
The article, "Introduction to Object-Oriented Programming Using FiveWin" is in two parts.
>I am getting an error that I don´t have if I use the original class.
I see nothing wrong with the code you show so the problem must be in the code you didn't show us. Can you provide us with a small REAL example. Which FW class are trying to inherit from? What is the error you are getting? What version of FW are you using?
James
Re: Classes inheritance. How to ?
Why ?Gale FORd wrote:Don't forget to add:concentra wrote:Where can I find a tutorial and/or documentation about how to create and inherit FWH classes ?
Is there one around ?
I am triing to inherit a class from another because I need to add a method.
I am getting an error that I don´t have if I use the original class.
The object seems not ot be created at all...
The code is something like this:
Class CL2 from CL1
METHOD PrintCl()
ENDCLASS
METHOD PrintCl() class CL2
alert("CL2")
return NIL
Questions:
Al the CL1 methods are avaiable in CL2 ?
Do I need a constructor/destructor method or the CL1 one is used ?
[[]] Maurício Faria
CLASSDATA lRegistered AS LOGICAL
What is "lRegistered" ?
[[]] Maurício Faria
James Bott wrote:Maurício,
There are a couple of articles that I wrote on this available on my website here:
http://ourworld.compuserve.com/homepage ... rogram.htm
The article, "Introduction to Object-Oriented Programming Using FiveWin" is in two parts.
>I am getting an error that I don´t have if I use the original class.
I see nothing wrong with the code you show so the problem must be in the code you didn't show us. Can you provide us with a small REAL example. Which FW class are trying to inherit from? What is the error you are getting? What version of FW are you using?
James
Thanks James.
I am reading it and it seems very usefull for a beginning.
Can I translate to Portuguese ?
[[]] Maurício Faria
- jose_murugosa
- Posts: 943
- Joined: Mon Feb 06, 2006 4:28 pm
- Location: Uruguay
- Contact:
Article about OOP in fivewin
James,
Your articles are very interesting, I´m studying them.
I will translate them to spanish and send to your e-mail.
Your articles are very interesting, I´m studying them.
I will translate them to spanish and send to your e-mail.
Saludos/Regards,
José Murugosa
FWH + Harbour + Bcc7. Una seda!
José Murugosa
FWH + Harbour + Bcc7. Una seda!
Re: Classes inheritance. How to ?
EnricoMaria wrote:Best documentation is FWH source code.concentra wrote:Where can I find a tutorial and/or documentation about how to create and inherit FWH classes ?
I tried but could not figure out what is wrong with my code.
I thought I needed to study a little if some docs are avaiable.
EnricoMaria wrote:Can you build a little real (compilable) sample of the problem?concentra wrote:I am triing to inherit a class from another because I need to add a method.
I am getting an error that I don´t have if I use the original class.
The object seems not ot be created at all...
The code is something like this:
Class CL2 from CL1
METHOD PrintCl()
ENDCLASS
METHOD PrintCl() class CL2
alert("CL2")
return NIL
I am triing to add some methods to the SuperBrowse class without modifiing it, and so I tried to inherit it, creating a particular class.
I will try to find what is wrong with the code with the help you gave me and if I can´t I will try to post complete code.
EnricoMaria wrote:Yes.concentra wrote:Questions:
Al the CL1 methods are avaiable in CL2 ?
Yes, you need of a constructor.concentra wrote:Do I need a constructor/destructor method or the CL1 one is used ?
EMG
[[]] Maurício Faria
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Classes inheritance. How to ?
Bingo !!!!!Gale FORd wrote:Don't forget to add:
CLASSDATA lRegistered AS LOGICAL
Added this single line and my inherited class worked like a charm...
Thanks Gale, but what the hell is "lRegistered" ?
[[]] Maurício Faria
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Classes inheritance. How to ?
It is a flag that allows a one-time registration of a control class. It is needed to get Windows aware of the new control.
EMG
EMG
Re: Classes inheritance. How to ?
EnricoMaria wrote:It is a flag that allows a one-time registration of a control class. It is needed to get Windows aware of the new control.
EMG
Ok, but could you tell me when I need it and when I do not ?
[[]] Maurício Faria
Re: Classes inheritance. How to ?
If you are creating a temporary stand alone class from scratch and you will not inherit from it then it is not requiredconcentra wrote:EnricoMaria wrote:It is a flag that allows a one-time registration of a control class. It is needed to get Windows aware of the new control.
EMG
Ok, but could you tell me when I need it and when I do not ?
[[]] Maurício Faria
If you plan on inheriting from your class or your class is inheriting from another, then you will need to add it.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Classes inheritance. How to ?
No, you will only need it if you are going to make a control. Not all classes are controls.Gale FORd wrote:If you are creating a temporary stand alone class from scratch and you will not inherit from it then it is not required
If you plan on inheriting from your class or your class is inheriting from another, then you will need to add it.
EMG