PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Call the previous class
Call the previous class
Débuté par HECTOR, 10 oct. 2016 16:48 - 2 réponses
Membre enregistré
26 messages
Posté le 10 octobre 2016 - 16:48
Greetings, anyone know if it's possible make a call from one class to the class that has created it?

Class1 has an instance of Class2, I want to call a method of Class1 from Class2.

Among them there is none inheritance relationship.
Posté le 10 octobre 2016 - 19:50
Hi Hector,

you can pass the original object (of class1) to the object of class 2,
store it there in a dynamic object, and call any of it's methods

Best regards


--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Le 10/10/2016 à 8:48 AM, HECTOR a écrit :
Greetings, anyone know if it's possible make a call from one class to
the class that has created it?

Class1 has an instance of Class2, I want to call a method of Class1 from
Class2.

Among them there is none inheritance relationship.
Membre enregistré
26 messages
Posté le 11 octobre 2016 - 09:21
Thanks Fabrice It Works.

I made in Class1 this methods:

Procedure Create()

oClass.NewClass(object)

Procedure TestMethod()

Info("ok")


And in Class2 this:

Procedure NewClass(oClass1 is dynamic object)

oClass1.TestMethod()


So when I call Class1.Create() It shows "ok"