As a reference to a window from a class method

good day

I have a class with a method that calls another method in a module, this method has a type parameter window and through all the controls.

The meto class is as follows:

Sub New ()
MyModulo.mEnableObj (Self, me.EstadoEditar)
End sub

MyModulo.mEnableObj (w windows As if AS Boolean)
Dim i As Integer
dim ctl as rectControl
for i = 0 to w.controlCount - 1
if NOT w.Control (i) isa Then rectControl
// continue move to the next control on the loop

 ctl = RectControl (w.control (i))
 Then if ctl isa TextField
   TextField (w.Control (i)). Enabled = yes
 Then isa elseif ctl ComboBox
   ComboBox (w.Control (i)). Enabled = yes
 Then isa elseif ctl PopupMenu
   PopupMenu (w.Control (i)). Enabled = yes


When I run the code from the class to do nothing.
But when I run the code from a window the code works.

As I can do to make the code work from the class.