Another declare question.
I have a method returning a Ptr like this one:
Function resultAtIndex(index as integer) As Ptr
declare function resultAtIndex lib "Cocoa" selector "resultAtIndex:" (class_id as ptr, index as integer) as Ptr
return resultAtIndex(self, index)
End Function
This is a methond from NSMetadataQuery returning a NSMetadataItem.
Now I have a custom class “NSMetadataItem” and I want to assign the returned Ptr to that class.
Unfortunately it does not work just using
dim NSMetadataItemRef as NSMetadataItem = me.resultAtIndex(index)
and I had no success via casting or what ever I tried (I even looked at the help page for Ptr!).
Any idea how to give the returned Ptr the proper type?
Oh I see.
So that is the way to proceed. I thought there would be a easier way to cast a Ptr to any class instance which would be handy for declare usage.