on 12-08-2004 5:22 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.