Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Problem pasing by reference to DLL
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ABC  
View profile  
 More options Sep 17 2012, 1:19 pm
Newsgroups: comp.lang.apl
From: "ABC" <A...@enoemail.com>
Date: Mon, 17 Sep 2012 13:19:25 -0400
Local: Mon, Sep 17 2012 1:19 pm
Subject: Re: Problem pasing by reference to DLL
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-micenewgro...@yahoo.co.uk> wrote in message

news:ou6dnXMbju2AzcrNnZ2dnUVZ8h2dnZ2d@bt.com...

"ABC" <A...@enoemail.com> wrote in message

news:5eednf4YVtygpcrNnZ2dnUVZ_rSdnZ2d@giganews.com...

> 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?

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.