Skip to Content
author's profile photo Former Member
Former Member

instantiate a window object

good morning


I'm with a problem, I want to call a property of a window without this method is open to the OPEN (), by theme assurances of my application because if I go without opening that window and I get NULL parameters.
I tried to do it with the CREATE instantiating and other forms but errors out.

I need a way in which you can view the properties of the window without running or make it visible to the user

Appreciating your help

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2014 at 05:23 PM

    Hi Cesar;

    You might want to check out the FindDefintion ( ) method this returns a ClassDefinition object. You should be then able to "introspect" the CD object for the variables, properties & methods you ae hoping to find present before instantiating the real window.

    HTH

    Regards ... Chris

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      thanks for your help

      I enclose the portion of code that helped me solve my problem, i need de window's tag


      integer li_i

      ClassDefinition cd

      VariableDefinition vd_def

      cd = FindClassDefinition(ao_windows)

      For li_i = 1 To UpperBound (cd.VariableList)

      vd_def = cd.VariableList[li_i]

      if vd_def.name = "tag" then

      MessageBox ("Variable Name: ", vd_def.name )

      MessageBox ("Variable Value: ", string(vd_def.initialvalue) )

      end if

      Next

  • Posted on Jan 07, 2014 at 04:57 PM

    What properties are you trying to get?

    This might do what you need:

    w_mywindow lw_win

    int li_x

    lw_win = create w_mywindow

    li_x = lw_win.x

    If not you'll need to explain your needs.

    Cheers

    David

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2014 at 06:37 PM

    It would be useful to know exactly why you need to access a "property" of a window that has not been instantiated (or opened); this is not a very common activity within a general purpose application.

    However, I suggest a very different approach. If there is "information" that your application needs to store/access that can be related to a window, then perhaps it makes more sense to create a NVO class to do this. This class can then be a "factory" and used to open the window(s) associated with this information.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.