[Mono-osx] Handle Question

Rodrigo Kumpera kumpera at gmail.com
Fri Apr 20 00:48:59 UTC 2012


OSError NewSomeApiPtr (ref IntPtr);

On Thu, Apr 19, 2012 at 8:09 PM, Chris McKinnon <crmckinnon at shaw.ca> wrote:

> Hi,
>
> I'm writing some new code that is calling through to native Mac OS
> libraries.  For the most part I've found IntPtr works well for getting back
> values.  How do you handle getting back a Handle (a pointer to a pointer)?
>  For example:
>
> struct SomeApiRecord {
>   long                data[1];
> };
> typedef struct  SomeApiRecord      SomeApiRecord;
> typedef  SomeApiRecord *           SomeApiPtr;
>
> Then the function calls might be:
>
> OSError NewSomeApiPtr(SomeApiPtr* ptr);
> OSError DoSomething(SomeApiPtr ptr);
> OSError DisposeSomeApiPtr(SomeApiPtr ptr);
>
> Only the "New" call returns a handle.  The rest use a pointer.  Any help
> would be appreciated.
>
> Thanks,
>
> Chris McKinnon
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-osx/attachments/20120419/96ada68e/attachment.html>


More information about the Mono-osx mailing list