On 29-Apr-07, at 10:55 PM, Thomas Cunningham wrote:

> Christian, this is a plugin free project for me. :-)
>
> Norman Wrote:
>>> RedBlackRedRampEvaluate(ByRef info As MemoryBlock, inValue As
>>> MemoryBlock, ByRef outValue As MemoryBlock)
>
>> This should just be Ptr. Byref is not required.
>> RedBlackRedRampEvaluate( info As Ptr, inValue As Ptr, outValue As  
>> Ptr)
>
> Charles Wrote:
>> Probably you should declare all three parameters to be of type
>> MemoryBlock.
>
>> Sub RedBlackRedRampEvaluate(info as MemoryBlock, inValue as
>> MemoryBlock, outValue as MemoryBlock)
>
> These two replies indicate my fundamental question. It appears that  
> there is
> no *correct* answer, other than to try each out and see what  
> works. :-)

Not quite
There are at least two equally acceptable way to this :)

> Norman Wrote:
>> The caller puts them on the stack (usually) according to that
>> lannguages calling conventions (which appear to be C)
>> They should be set already when you are called assuming there's
>> nothing funky about calling conventions.
>
> I'm still confused. Let's say you have a Routine and a call,
>   // Method
>   MyTestRoutine(aPtr As MemoryBlock)
>   // a Call
>   Dim temp As New MemoryBlock(12)
>   temp.Ptr(4) = AddressOf MyTestRoutine
>
> How does Rb find the parameter aPtr in MyTestRoutine? By name?

MyTestRoutine is like any other method in your code.
You have a bunch of declared parameters, and you use the DECLARED  
parameter name just like any other method.

If you wrote a new method in your code called Foo like

        sub Foo(bar as integer, baz as string)

and call it like

        Foo(beer, wine)

in the method the name s you use to refer to parameters are bar and  
baz regardless

Same for the callback

You use the names or the parameters as declared in the method
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to