Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem pasing by reference to DLL

54 views
Skip to first unread message

ABC

unread,
Sep 17, 2012, 10:47:14 AM9/17/12
to
I'm calling a simple DLL from APL-PLUS Win 4.0 using []NA. The DLL accepts
a DWORD pointer. Here's the []NA syntax.

'DLL I4<-Patterns_03.AddUp(*I4)' []NA 'Patterns_03'

Then I call it this way:

A <- (iota) 10

Patterns_03 (A)

I get: LENGTH ERROR

If I call: Patterns_03 (A[1]) the DLL returns the correct result for A[1].
The same is true if I pass any index to the end of the vector A -- for
example, Patterns_03 (A[6]) returns the correct result for A[6]. But my
[]NA shows that I'm passing it by reference, not by value.

Any ideas?

Thanks very much.



Graham

unread,
Sep 17, 2012, 12:30:19 PM9/17/12
to

"ABC" <A...@enoemail.com> wrote in message news:5eednf4YVtygpcrN...@giganews.com...
Here's a long shot!!! Most none array type languages usually require a pointer to an APL vector followed by the length of that vector. Is it possible to specify your []NA as:

'DLL I4<-Patterns_03.AddUp(*I4,I4)' []NA 'Patterns_03'

and then call:

Patterns_03 (A) ({rho}A)

ie the pointer is to the first element in A followed by the length of A. Just a guess.

Graham.

ABC

unread,
Sep 17, 2012, 1:19:25 PM9/17/12
to
Hi, Graham,

Thank you very much. That was not a long shot, it was the correct answer!

My DSL is written in assembler (MASM). The APL-PLUS documentation includes
an example of a C++ program that takes two parameters, the pointer and the
length. However, as I am passing a fixed-length vector, I don't need to
pass the length so I don't have the length parameter. I didn't realize that
the DLL might need that information even though the program takes only one
input (the pointer). However, when I specified it as you (and the
documentation) showed, it worked.

Thanks again for your reply.



"Graham" <h2gt2g42-mi...@yahoo.co.uk> wrote in message
news:ou6dnXMbju2AzcrN...@bt.com...
0 new messages