Cause of Error message in declare?

I posted a question/problem in MacOs yesterday and got answers, however when I finally tested I got an error that I don’t understand.

The discussion from yesterday.

The direct solution was Rob’s answer
Thanks to Jared for helping me understand declares.
I however get an error at this line

dim myTextArea as ptr = documentView(self.Handle)

Finally the error message:[quote]Error: -[XOJWindow documentView]:
unrecognized selector sent to instance 0x691343e0[/quote]
I’m not sure which part is the error. Please show me how to correct it.
I’m also interested in using this declare with an array of textarea controls

The error message says it: XOJWindow has no method documentView. So:

dim myTextArea as ptr = documentView(self.Handle)

is wrong. It needs to be:

dim myTextArea as ptr = documentView(TextAreaXYZ.Handle)

This ended up being solved in the other thread.
It was a Self vs. Me issue (since the code was used in the open event of the control) for anyone that’s only reading this here.