Christian Schmitz wrote:
> Tim Jones <[EMAIL PROTECTED]> wrote:
>
>
>> Hi Folks,
>>
>> Working on a plugin being developed from a current Linux shared library
>> that requires 2 structs of shorts passed in and a third struct of shorts
>> for the results to be returned. I understand the process of passing in
>> the structs as MemoryBlocks as Ptr, and passing the third struct as a
>> memoryblock byref as a Ptr.
>>
>> My question is what type of object am I creating when I add my RB
>> function? Here's the actual function call definition:
>>
>> static void MontgomeryReduction(unsigned short *m1,
>> unsigned short *m2,
>> unsigned short *result)
>>
>> What type of the entry in the pluginMethodArray[]? For example:
>>
>> static REALmethodDefinition pluginMethodArray[] = {
>> { (REALproc) ModularExp, REALnoImplementation,
>> "ModularExp(MemoryBlock As Ptr,
>> MemoryBlock As Ptr,
>> ByRef MemoryBlock As Ptr)" },
>> };
>>
>
> "ModularExp(m1 As MemoryBlock,
> m2 As MemoryBlock,
> r As MemoryBlock)" },
>
> Just pass memoryblocks.
>
Thanks Christian. Since 'r' is going to be modified by the algorithm,
shouldn't the entry be "ByRef r As MemoryBlock"? Also, am I using the
correct identifier for this type of function (accept 3 memoryblocks,
modify the contents of the 3rd) when I use "REALNoImplementation"?
Let me see if I understand how this *should* work:
The change above works and my ModularExp() method nows autocompletes in
the IDE editor - however, the helper text does not show up in the IDE's
status bar.
When I run my code in a pushbutton's action event - a simple creation:
Dim m1 As New MemoryBlock(64*2) // 64 shorts
Dim m2 As New MemoryBlock(64*2)
Dim r As New MemoryBlock(64*2)
Dim x As Integer
For x = 0 to 63
m1.UShort(x * 2) = &hffff
m2.UShort(x * 2) = &h0000 // just to make sure
r.UShort(x * 2) = &h0000
Next
m2.UShort(0) = &h5 // run the reduction loop 5 times
ModularExp(m1, m2, r)
I get a hard crash. My first thought was that I needed to pass result
as ByRef (the contents of result() are changed to contain the result),
but I get the same error.
If I take the Plugin back to a standalone tool, the compiled app runs
with no errors.
Any thoughts or guidance on how to troubleshoot / debug this?
Tim
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>