Skip to Content

how to call Method from wdDoModifyView()

Hi,

I have a private method and i wanna call this method from wdDoModifyView() hook method.

but when i call mthod it gives me error the method dim() from the type ..view is not static.

can any one tell me how can i access this method?

best regards

Yasir Noman

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 08, 2004 at 07:46 PM

    Why do you need this call from within wdDoModifyView() at all? The purpose of wdDoModifyView() is to have a single place where the view may be accessed and manipulated. Is this really needed in your use case?

    Armin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 08, 2004 at 06:25 PM

    Hi Yasir,

    i'm not sure what you mean with the "dim()" method. I guess this is the non-static method you want to call from wdDoModifyView()? You should already get a compile-time error, not only a runtime error.

    The reason is simple: There is <b>no</b> possibility to call non-static methods from a static context. Static methods "belong to" a class while non-static methods "belong to" instances of a class.

    A simple alternative is to declare dim() as public using the "Methods" tab of the corresponding view controller and use the "wdThis" reference you are getting as a parameter of the wdDoModifyView() method such as you can call wdThis.dim().

    It's <b>not</b> sufficient just to change the method to public inside the //@others section, since wdThis will not know the method then since it's not part of the controller metadata.

    Hope that helps.

    Regards

    Stefan

    Add comment
    10|10000 characters needed characters exceeded