realbasic-nug
[Top] [All Lists]

Re: Another Declare-related question

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Another Declare-related question
From: Mars Saxman <mars at realsoftware dot com>
Date: Wed, 30 Nov 2005 17:02:28 -0800
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <eb8fc1930511301658q56ed42d7wa851f133cee68ac4 at mail dot gmail dot com>

On Nov 30, 2005, at 4:58 PM, dda wrote:

Me again,

I have a C function that takes a callback function, and the callback
should look like this:

int my_calback(void *buffer, size_t size, size_t nmemb, void *stream)

Is it possible to have an RB Method act as callback?

Sure - look up the "AddressOf" operator. The callback method should be in a module, not a class, and the signature should look something like this:

Function my_callback(buffer As Ptr, size As Integer, nmemb As Integer, stream As Ptr) As Integer

Mars Saxman
REAL Software
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>