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 a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on 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 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.